Skip to content

Disable static cache on certain MoE models#39108

Open
ivarflakstad wants to merge 4 commits into
mainfrom
set-supports-static-cache-false-on-moes
Open

Disable static cache on certain MoE models#39108
ivarflakstad wants to merge 4 commits into
mainfrom
set-supports-static-cache-false-on-moes

Conversation

@ivarflakstad

Copy link
Copy Markdown
Member

No description provided.

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

@ivarflakstad ivarflakstad requested a review from ydshieh June 30, 2025 12:32
@ivarflakstad ivarflakstad marked this pull request as ready for review June 30, 2025 12:32
@ivarflakstad

Copy link
Copy Markdown
Member Author

run-slow: deepseek_v3

@github-actions

Copy link
Copy Markdown
Contributor

This comment contains run-slow, running the specified jobs:

models: ['models/deepseek_v3']
quantizations: [] ...


@auto_docstring
class DeepseekV3Model(DeepseekV3PreTrainedModel):
_supports_static_cache = False

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we only need the one in class DeepseekV3PreTrainedModel(PreTrainedModel) as DeepseekV3Model here is just a subclass of it.

_tied_weights_keys = ["lm_head.weight"]
_tp_plan = {"lm_head": "colwise_rep"}
_pp_plan = {"lm_head": (["hidden_states"], ["logits"])}
_supports_static_cache = False

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same as above



class DeepseekV3Model(LlamaModel):
_supports_static_cache = False

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wait this isn't the same is it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

hm, but do we still need this one, if the one in modeling_deepseek_v3 is removed?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i mean, adding this here means we want it to appear for

class DeepseekV3Model(DeepseekV3PreTrainedModel):

but we don't need it there, so we can remove this one here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm sure you're right hehe.
Haven't yet had the time to fully understand exactly how modular works 😅

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(me neither just my raw thoughts 😅 )

@ydshieh ydshieh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK, but a nit that is good to change 🙏

Thanks a lot!

@ivarflakstad

Copy link
Copy Markdown
Member Author

@ydshieh could you take a look at the results from the model tests I ran?
Doesn't look like this had the intended effect

@ydshieh

ydshieh commented Jun 30, 2025

Copy link
Copy Markdown
Collaborator

we should skip the integration test

tests/models/deepseek_v3/test_modeling_deepseek_v3.py::DeepseekV3IntegrationTest::test_compile_static_cache

that one doesn't use the flag to control the test. It's integration test and usually not control by the flag.

@github-actions

Copy link
Copy Markdown
Contributor

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

run-slow: deepseek_v3, dots1

@ivarflakstad ivarflakstad force-pushed the set-supports-static-cache-false-on-moes branch from 662d1e0 to ee85f48 Compare July 28, 2025 15:59
@ivarflakstad

Copy link
Copy Markdown
Member Author

run-slow: deepseek_v3, dots1

@github-actions

Copy link
Copy Markdown
Contributor

This comment contains run-slow, running the specified jobs:

models: ['models/deepseek_v3', 'models/dots1']
quantizations: [] ...

@ivarflakstad

Copy link
Copy Markdown
Member Author

run-slow: deepseek_v3, dots1

@github-actions

Copy link
Copy Markdown
Contributor

This comment contains run-slow, running the specified jobs:

models: ['models/deepseek_v3', 'models/dots1']
quantizations: [] ...

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