You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b646a67
Browse filesBrowse the repository at this point in the historyBrowse files
docs(model): attribute adopted code in the Nemotron implementation
Modalities is MIT licensed; Megatron-LM, Megatron-Bridge and state-spaces/mamba
are Apache 2.0 (NVIDIA / Tri Dao, Albert Gu) and TorchTitan is BSD 3-Clause.
Preserving those notices in the derived files is a license obligation, so each
source file that adapts upstream code now carries a header naming the upstream
file, what was taken from it, the copyright holder and the license.
Marked as adapted from Megatron-LM:
* mamba2_mixer.py - packed [z, x, B, C, dt] projection layout, conv1d/A_log/D/
dt_bias shapes and initialization distributions
* layer_pattern.py - the layer pattern symbols
* nemotron_layers.py - single-operator pre-norm residual layer structure
* nemotron_layer_specs.py - the declarative ModuleSpec/builder pattern
* nemotron_model.py - hybrid model structure
* router.py - sigmoid scoring, selection-only expert bias, renormalization
* moe.py - the load-balancing loss formula and its sequence-level variant
* load_balancing.py - the sign-based expert bias update rule
* experts.py, nemotron_mlp.py - the squared ReLU activation
Marked as adapted from state-spaces/mamba:
* ssd.py - the chunk-parallel SSD block decomposition (ssd_minimal_discrete /
segsum) and the GatedRMSNorm semantics
Marked as adapted from TorchTitan (following the convention already used in
model_factory.py and trainer.py):
* experts.py - stacked per-expert weights and the torch._grouped_mm call
* moe.py - dispatch/combine structure, expert-bias and token-count buffers
* router.py - router interface shape
* load_balancing.py - the optimizer step pre-hook approach
* nemotron_stages_generator.py - pipeline split-point structure
Marked as adapted from Meta's Llama:
* nemotron_attention.py - grouped-query key/value head repetition
The YAML configs note that their hyperparameter values are adopted from the
Megatron-Bridge recipe; no code was taken from Megatron-Bridge.
docs/components/nemotron.md gains an Attribution section tabulating all of the
above in one place, and explicitly lists the files with no third-party
derivation (norms.py, nemotron_model_factory.py, nemotron_mfu.py, and the
partitioning algorithm in nemotron_stages_generator.py).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| [moe.py](../../src/modalities/models/components/moe/moe.py) | Load-balancing loss formula and its sequence-level variant | `.../moe_utils.py::switch_load_balancing_loss_func` |
| [load_balancing.py](../../src/modalities/models/components/moe/load_balancing.py) | Applying the bias update as an optimizer step pre-hook | `.../moe.py` |
| [nemotron_attention.py](../../src/modalities/models/nemotron/nemotron_attention.py) | Grouped-query key/value head repetition (`_repeat_kv`), via Modalities' own GPT-2 | `llama/model.py` |
0 commit comments