Skip to content

[HybridCache] disable automatic compilation#36620

Merged
gante merged 2 commits intohuggingface:mainfrom
gante:disable_auto_compilation_hybrid_cache
Mar 10, 2025
Merged

[HybridCache] disable automatic compilation#36620
gante merged 2 commits intohuggingface:mainfrom
gante:disable_auto_compilation_hybrid_cache

Conversation

@gante
Copy link
Contributor

@gante gante commented Mar 9, 2025

What does this PR do?

Recently I've expanded auto compilation in generate from StaticCache only to all compilable caches, through a new is_compileable attribute.

This PR sets HybridCache.is_compileable to False, which stops automatic compilation. There have been reports of speed loss on models that use this cache -- disabling until the root cause is found.

@gante gante requested a review from zucchini-nlp March 9, 2025 20:26
@github-actions github-actions bot marked this pull request as draft March 9, 2025 20:26
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2025

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the Ready for review button (at the bottom of the PR page).

@gante gante marked this pull request as ready for review March 9, 2025 20:27
@gante gante force-pushed the disable_auto_compilation_hybrid_cache branch from c21f46f to a75a906 Compare March 9, 2025 20:48
⚠️ Runs two sequential generations to ensure the cache doesn't get stuck after the first compiled run! ⚠️
"""
# Monkey-patching the HybridCache at test-time to continue testing compilation support
HybridCache.is_compileable = True
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(CI also fails without this change :) we would need to rewrite the test)

@HuggingFaceDocBuilderDev

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.

Copy link
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

thanks and indeed better to disable while we don't know what's happening!

@gante gante merged commit 8585450 into huggingface:main Mar 10, 2025
23 checks passed
@gante gante mentioned this pull request Apr 11, 2025
2 tasks
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