cp: fix: Coerce plain-dict backend to BackendConfig in model init (1784) into r0.4.0#1803
Merged
cp: fix: Coerce plain-dict backend to BackendConfig in model init (1784) into r0.4.0#1803
fix: Coerce plain-dict backend to BackendConfig in model init (1784) into r0.4.0#1803Conversation
* fix: Coerce plain-dict backend to BackendConfig in model init When backend is specified via CLI override (e.g. --model.backend.attn sdpa) without a _target_ key in the YAML, the config system passes it as a plain dict. This causes AttributeError in model constructors that do backend.rms_norm, backend.linear, etc. Convert the dict to BackendConfig(**dict) in _init_model, which is the single gateway between the config system and all model constructors. This fixes the issue for all 17+ custom model implementations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: adil-a <adil.asif2000@hotmail.com> * test: Add unit tests for dict-to-BackendConfig coercion Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: adil-a <adil.asif2000@hotmail.com> * style: Remove unused pytest import Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: adil-a <adil.asif2000@hotmail.com> * fix(test): Use environment-aware BackendConfig defaults in assertion BackendConfig defaults for attn/linear depend on TE availability, so hardcoding "torch" fails on GPU CI where TE is present. Compare against BackendConfig() defaults instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: adil-a <adil.asif2000@hotmail.com> * fix(test): Compare inputs_embeds generate against input_ids generate The old test compared cached generate(inputs_embeds) against manual uncached decode (use_cache=False). Mamba uses different CUDA kernels for cached vs uncached paths, causing bf16 divergence. Compare both generate() paths instead, which both use cached kernels. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: adil-a <adil.asif2000@hotmail.com> --------- Signed-off-by: adil-a <adil.asif2000@hotmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
Contributor
Author
|
/ok to test 36d1923 |
Contributor
|
/ok to test 44979df |
akoumpa
approved these changes
Apr 19, 2026
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.
beep boop [🤖]: Hi @adil-a 👋,