Skip to content

[Moshi] disable automatic compilation if the model can't compile#35992

Merged
gante merged 2 commits intohuggingface:mainfrom
gante:moshi_compile_fix
Jan 31, 2025
Merged

[Moshi] disable automatic compilation if the model can't compile#35992
gante merged 2 commits intohuggingface:mainfrom
gante:moshi_compile_fix

Conversation

@gante
Copy link
Copy Markdown
Contributor

@gante gante commented Jan 31, 2025

What does this PR do?

Don't trigger automatic compilation if the model can't compile. #34544 enabled automatic compilation with any compilation-ready cache. However, some models default to compilation-ready caches AND don't support compilation, e.g. Moshi

Supercedes #35986; Carved from #35989 to reduce the size of that PR.

Fixes Moshi generation tests, e.g. py.test tests/models/moshi -k test_greedy_generate -vv

@gante gante requested a review from ydshieh January 31, 2025 14:47
Copy link
Copy Markdown
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

LGTM.

I have a previous PR somehow related to this situation

#34975

I kind start feeling _supports_static_cache is a bit misleading, as now it turns out meaning we can use static cache, but compilation will fail, but it's more a naming issue.

@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.

@gante
Copy link
Copy Markdown
Contributor Author

gante commented Jan 31, 2025

@ydshieh I agree the name is misleading, and has been repurposed for compilation things. Happy to rename it to _supports_compilation, WDYT?

@ydshieh
Copy link
Copy Markdown
Collaborator

ydshieh commented Jan 31, 2025

I would love it renamed, but since it's an (despite being private) attribute of the important/base class PreTrainedModel, I feel more comfortable if Arthur is not against this change.

(and we can do it in a separate PR, so you can merge this one quickly if you wish)

@gante
Copy link
Copy Markdown
Contributor Author

gante commented Jan 31, 2025

yes, let's do it in a separate PR :)

@gante gante merged commit 5bbee12 into huggingface:main Jan 31, 2025
yaswanth19 pushed a commit to yaswanth19/transformers that referenced this pull request Feb 5, 2025
bursteratom pushed a commit to bursteratom/transformers that referenced this pull request Feb 5, 2025
elvircrn pushed a commit to elvircrn/transformers that referenced this pull request Feb 13, 2025
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Feb 16, 2025
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.

3 participants