Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

gante
Copy link
Member

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

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
Member 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
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
Member 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
25 checks passed
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