-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Adding code for Flextron #4429
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
Merged
Merged
Adding code for Flextron #4429
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
fa17762
Added flextron code, training/eval example scripts, functional and un…
sheliang-nv cb56a0f
Removed flextron examples
sheliang-nv 4c18286
Added Flextron overrides to load_teacher_model_config
sheliang-nv c38d1f1
Added all reduce Flextron router grads for PP
sheliang-nv 3b8f6ff
Merge remote-tracking branch 'main/main' into shel/flex_merge
sheliang-nv 892ca2f
Sync with upstream main: adopt Hybrid* naming and new pretrain() entry
sheliang-nv 8b9ffae
Applied linter fixes
sheliang-nv 044965d
Merge branch 'main' into shel/flex_merge
sheliang-nv aab70ea
Fixed multi argument wrong formatting for flextron functional test
sheliang-nv c03c840
Added explicit arg model type for flextron func test
sheliang-nv 93608a8
Bugfix for when main_param is None
sheliang-nv 3c864d3
Added golden values for functional test
sheliang-nv b53eba1
Removed commented out block
sheliang-nv e8c12da
Removed comments and dead code, redundant all reduces from loss_func.…
sheliang-nv e05503d
Removed hardcoded teacher config fields
sheliang-nv fe19e6a
Removed comments, redundant reporting_loss, and defaulted teacher fle…
sheliang-nv 115f5b5
Elastification autoformatted
sheliang-nv 7f2b92f
Assertion message bugfix for flextron_elasticity_hooks.py
sheliang-nv 0ae4d4d
Update functional test to use HybridModel
sheliang-nv 39b93a3
Raise error bugfix in pretrain_mamba_flex.py
sheliang-nv 6b742b6
Bugfix for config.override_selected_budget
sheliang-nv 77bd779
Uncomment budget fallback when not not set in args
sheliang-nv 0f0ac6f
Removed dead out_proj_mask_list, moved training script to elastificat…
sheliang-nv f871331
Fixed typos and renamed router param attr for PP sync
sheliang-nv 32c7d09
Changed entry path for flextron functional test
sheliang-nv 160336b
Removed unused imports and dead config field
sheliang-nv e975d5e
Merge branch 'main' into shel/flex_merge
sheliang-nv 33b5c9e
Removed attention head masking
sheliang-nv 96c8e5c
Removed head masking args from tests
sheliang-nv 1570c80
Fix expert_bias mutation, PP-sync test attr, pretrain() signature
sheliang-nv b8bdfd6
Removed dead code and comments, added init file for router
sheliang-nv 9311c95
Fix MoE expert MSE drop, mlp_per UnboundLocalError, budget=1.0 fallba…
sheliang-nv 0894912
Added args check for int-per-lists, added loss_func unit test
sheliang-nv 41e8976
Fix budget=1.0 KeyError paths, retire original_model kill-switch, sor…
sheliang-nv c2f58f9
Fix CUDA RNG leak in DP gumbel softmax, update stale loss_func docstring
sheliang-nv f68b0e6
Removed unused imports and added double check for MLP hook
sheliang-nv 3292cf7
Add unit tests for FlextronTopKRouter and FlextronGroupedMLP elastici…
sheliang-nv 7e4c52e
Autoformat
sheliang-nv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new function modifies a core distributed file but has no unit test coverage. A test verifying the all-reduce behavior (especially the VPP gradient aggregation logic in lines 291-313) would help prevent regressions, since bugs here would silently produce incorrect router gradients across pipeline stages.