Fix Mistral-Small-3.1-24B contrib: get_neuron_config_cls returns wrong class#112
Open
jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
Open
Fix Mistral-Small-3.1-24B contrib: get_neuron_config_cls returns wrong class#112jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
Conversation
Hoomaaan
approved these changes
Apr 8, 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.
Description
This is a fix to an existing contrib model, not a new contribution.
The
Mistral3InferenceConfig.get_neuron_config_cls()method returns the baseNeuronConfiginstead ofMistral3NeuronConfig. This means the customattn_clsfield defined inMistral3NeuronConfigis never used.Changes
One-line fix in
modeling_mistral3.py: changeget_neuron_config_clsto returnMistral3NeuronConfiginstead ofNeuronConfig.This is a correctness fix -- the decoder layer currently hardcodes
NeuronMistral3Attentiondirectly so theattn_clsfield onMistral3NeuronConfigis effectively dead code, but the config class should still return the correct subclass for consistency and to enable future use ofattn_cls.Validation Results
Files Changed
contrib/models/Mistral-Small-3.1-24B-Instruct-2503/src/modeling_mistral3.pyget_neuron_config_clsreturn typeTesting
Compiled and ran on trn2.3xlarge with TP=4, Neuron SDK 2.27, BF16. Model generates coherent text with 88% token match (4 of 5 prompts exact match against HuggingFace CPU reference).