Skip to content

Fix DynamicCache and simplify Cache classes a bit#39590

Merged
Cyrilvallez merged 8 commits intomainfrom
fix-cache-test
Jul 23, 2025
Merged

Fix DynamicCache and simplify Cache classes a bit#39590
Cyrilvallez merged 8 commits intomainfrom
fix-cache-test

Conversation

@Cyrilvallez
Copy link
Copy Markdown
Member

@Cyrilvallez Cyrilvallez commented Jul 22, 2025

What does this PR do?

As per the title. DynamicCache was broken because self.layers needs to exist if we want to append to it -> test_multi_gpu_data_parallel_forward was failing

cc @manueldeprada for viz

Copy link
Copy Markdown
Contributor

@manueldeprada manueldeprada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, LGTM! btw this test was run in PR tests some weeks ago, maybe there was a hardware change.

I am also running manually Nvidia's KVPress in case there are sneaky regression tests.

@Cyrilvallez Cyrilvallez changed the title Fix DynamicCache Fix DynamicCache and simplify a bit Jul 22, 2025
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Cyrilvallez Cyrilvallez changed the title Fix DynamicCache and simplify a bit Fix DynamicCache and simplify Jul 22, 2025
@Cyrilvallez Cyrilvallez changed the title Fix DynamicCache and simplify Simplify Cache classes and fix DynamicCache Jul 22, 2025
@Cyrilvallez
Copy link
Copy Markdown
Member Author

No no it has nothing to do with hardware here - you cannot append if the list does not exist

@manueldeprada
Copy link
Copy Markdown
Contributor

I know! I was mentioning that as a reason for the test to be skipped in the PR tests (since it requires multigpu)

@Cyrilvallez Cyrilvallez changed the title Simplify Cache classes and fix DynamicCache Fix DynamicCache and simplify Cache classes a bit Jul 22, 2025
@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: bamba, granitemoehybrid, jamba

@Cyrilvallez Cyrilvallez merged commit 5dba4bc into main Jul 23, 2025
26 checks passed
@Cyrilvallez Cyrilvallez deleted the fix-cache-test branch July 23, 2025 08:13
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix

* use kwargs

* simplify

* Update cache_utils.py

* Update cache_utils.py

* Update test_cache_utils.py

* fix

* style
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix

* use kwargs

* simplify

* Update cache_utils.py

* Update cache_utils.py

* Update test_cache_utils.py

* fix

* style
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix

* use kwargs

* simplify

* Update cache_utils.py

* Update cache_utils.py

* Update test_cache_utils.py

* fix

* style
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix

* use kwargs

* simplify

* Update cache_utils.py

* Update cache_utils.py

* Update test_cache_utils.py

* fix

* style
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix

* use kwargs

* simplify

* Update cache_utils.py

* Update cache_utils.py

* Update test_cache_utils.py

* fix

* style
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix

* use kwargs

* simplify

* Update cache_utils.py

* Update cache_utils.py

* Update test_cache_utils.py

* fix

* style
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix

* use kwargs

* simplify

* Update cache_utils.py

* Update cache_utils.py

* Update test_cache_utils.py

* fix

* style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants