transformers
Reduce by 2 the memory requirement in `generate()` 🔥🔥🔥
#30536
Merged

Commits
  • Fix contrastive_search for new cache structure, and improve performance by removing inneficient torch.stack(torch.split(x, top_k, dim=0))
    Cyrilvallez committed 2 years ago
  • Fix _contrastive_search for non-standard cache using ellipsis slicing
    Cyrilvallez committed 2 years ago
  • Fix all outputs.logits memory leaks for all decoding strategies!
    Cyrilvallez committed 2 years ago
  • Fix small error in _contrastive_search()
    Cyrilvallez committed 2 years ago
  • Make all necessary change and revert for the new class
    Cyrilvallez committed 2 years ago
  • Apply coding style
    Cyrilvallez committed 2 years ago
  • Remove pipes in type hints for compatibility
    Cyrilvallez committed 2 years ago
  • correct type hint
    Cyrilvallez committed 2 years ago
  • apply style
    Cyrilvallez committed 2 years ago
  • Use DynamicCache by default and solve conflicts
    Cyrilvallez committed 2 years ago
  • Fix rebase issues
    Cyrilvallez committed 2 years ago
  • Add `_supports_dynamic_cache_class` in models for models that support DynamicCache but not other caches to make DynamicCache the default for more models
    Cyrilvallez committed 2 years ago
  • Create generation config to return legacy format by default, or to choose not to
    Cyrilvallez committed 2 years ago
  • style
    Cyrilvallez committed 2 years ago
  • Fix case when use_cache is False
    Cyrilvallez committed 2 years ago
  • Remove default DynamicCache in assiste_decoding if assistant_model does not support it + fix _seen_tokens when cropping cache
    Cyrilvallez committed 2 years ago
  • Update prepare_inputs_for_generation() for case with empty DynamicCache
    Cyrilvallez committed 2 years ago
  • Correct return of args in _assisted_decoding
    Cyrilvallez committed 2 years ago
  • Remove EfficientDynamicCache as it is no longer needed
    Cyrilvallez committed 2 years ago
  • Correct mistake in generation config
    Cyrilvallez committed 2 years ago
  • Move cache logic of assisted decoding to AssistedCandidateGenerator.__init__
    Cyrilvallez committed 2 years ago
  • change DynamicCache function names from "split" to "batch_split" for readability + apply coding style
    Cyrilvallez committed 2 years ago
  • Remove `_supports_dynamic_cache_class` attribute after rebase
    Cyrilvallez committed 2 years ago
  • Correct missing line lost in conflict resolution during rebasing
    Cyrilvallez committed 2 years ago
  • Add special case for Jamba
    Cyrilvallez committed 2 years ago
  • Fix jamba test
    Cyrilvallez committed 2 years ago
  • Coding style
    Cyrilvallez committed 2 years ago
  • coding style
    Cyrilvallez committed 2 years ago
  • Correct missing import in rebasing
    Cyrilvallez committed 2 years ago
  • Simplify _validate_model_kwargs based on removal of _supports_dynamic_cache attribute
    Cyrilvallez committed 2 years ago
  • Simplify code paths in _contrastive_search
    Cyrilvallez committed 2 years ago
  • coding style
    Cyrilvallez committed 2 years ago
  • Update docstrings of cache methods
    Cyrilvallez committed 2 years ago
  • Update prepare_inputs_for_generation() -> past_key_values are always Cache objects
    Cyrilvallez committed 2 years ago
Loading