fix: prefer moe_config for num_experts in apply_ac#1361
Merged
Conversation
The num_experts config field name varies across HuggingFace model configs. Prioritize moe_config.n_routed_experts (which has a stable field name) before falling back to model.config attribute scanning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Hemil Desai <hemild@nvidia.com>
Contributor
Author
|
/ok to test 47e6fa4 |
adil-a
approved these changes
Feb 24, 2026
svcnvidia-nemo-ci
pushed a commit
that referenced
this pull request
Feb 24, 2026
The num_experts config field name varies across HuggingFace model configs. Prioritize moe_config.n_routed_experts (which has a stable field name) before falling back to model.config attribute scanning. Signed-off-by: Hemil Desai <hemild@nvidia.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
thomasdhc
pushed a commit
that referenced
this pull request
Feb 24, 2026
…`r0.3.0` (#1362) fix: prefer moe_config for num_experts in apply_ac (#1361) The num_experts config field name varies across HuggingFace model configs. Prioritize moe_config.n_routed_experts (which has a stable field name) before falling back to model.config attribute scanning. Signed-off-by: Hemil Desai <hemild@nvidia.com> Signed-off-by: NeMo Bot <nemo-bot@nvidia.com> Co-authored-by: Hemil Desai <hemild@nvidia.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
akoumpa
pushed a commit
that referenced
this pull request
Feb 25, 2026
The num_experts config field name varies across HuggingFace model configs. Prioritize moe_config.n_routed_experts (which has a stable field name) before falling back to model.config attribute scanning. Signed-off-by: Hemil Desai <hemild@nvidia.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
linnanwang
pushed a commit
that referenced
this pull request
Apr 24, 2026
The num_experts config field name varies across HuggingFace model configs. Prioritize moe_config.n_routed_experts (which has a stable field name) before falling back to model.config attribute scanning. Signed-off-by: Hemil Desai <hemild@nvidia.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apply_ac, thenum_expertsconfig field name varies across HuggingFace model configs (num_experts,moe_num_experts,n_routed_experts, etc.)moe_config.n_routed_experts(which has a stable, well-defined field name) before falling back to scanningmodel.configattributesmoe_configderivation and its priority over config attributesTest plan
test_apply_ac_derives_num_experts_from_moe_config— verifies moe_config path workstest_apply_ac_prefers_moe_config_over_config_attrs— verifies moe_config takes priority🤖 Generated with Claude Code