Skip to content

Fix broken imports in 4 existing contrib models#114

Open
jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
jimburtoft:sweeper/fix-broken-imports
Open

Fix broken imports in 4 existing contrib models#114
jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
jimburtoft:sweeper/fix-broken-imports

Conversation

@jimburtoft
Copy link
Copy Markdown
Contributor

Description

These are fixes to existing contrib models, not new contributions.

Four contrib models crash on import due to wrong module names or case mismatches in their __init__.py or test files. All fixes are mechanical -- no logic changes.

Fixes

Model File Issue Fix
Mixtral-8x7B-Instruct-v0.1 src/__init__.py Imports from .mixtral_model but file is modeling_mixtral.py from .modeling_mixtral import ...
OLMo-2-1124-7B src/__init__.py Imports from neuronx_port.modeling_olmo2 -- neuronx_port package doesn't exist from .modeling_olmo2 import ...
Qwen3-VL-8B-Thinking src/__init__.py Imports from neuronx_port.modeling_qwen3_vl -- same issue from .modeling_qwen3_vl import ...
biogpt test/integration/test_model.py Imports NeuronBioGPTForCausalLM / BioGPTInferenceConfig but actual class names use title case: NeuronBioGptForCausalLM / BioGptInferenceConfig Fix all references to match actual class names

Not included

helium-1-2b also has broken imports (helium_config and helium_model modules don't exist), but this is a deeper issue -- the HeliumInferenceConfig class is referenced throughout modeling_helium.py but never defined anywhere. That model needs its config class written, not just an import path fix.

Files Changed

File Change
contrib/models/Mixtral-8x7B-Instruct-v0.1/src/__init__.py Fix module name
contrib/models/OLMo-2-1124-7B/src/__init__.py Fix to relative import
contrib/models/Qwen3-VL-8B-Thinking/src/__init__.py Fix to relative import
contrib/models/biogpt/test/integration/test_model.py Fix class name casing

Testing

These are import-path fixes only -- no model logic is changed. Each fix corrects a ModuleNotFoundError or ImportError that prevents the contrib from being used at all.

Mixtral-8x7B: __init__.py imported from .mixtral_model but file is modeling_mixtral.py
OLMo-2-1124-7B: __init__.py imported from neuronx_port.modeling_olmo2 (nonexistent package)
Qwen3-VL-8B-Thinking: __init__.py imported from neuronx_port.modeling_qwen3_vl (nonexistent package)
biogpt: test imported NeuronBioGPTForCausalLM/BioGPTInferenceConfig (wrong case) -- actual classes use title case (BioGpt)

All four models crash on import before this fix. Changes are mechanical -- wrong module names and case mismatches only.
@jimburtoft
Copy link
Copy Markdown
Contributor Author

Validation Results

Tested on trn2.3xlarge spot instance (sa-east-1, SDK 2.28, LNC=2).

Import Validation (all 4 models)

All four models successfully import after the fix -- the classes are found and instantiated correctly:

Model Import Test Classes Found
Mixtral-8x7B PASS NeuronMixtralForCausalLM, MixtralInferenceConfig
OLMo-2-1124-7B PASS NeuronOlmo2ForCausalLM, Olmo2InferenceConfig, Olmo2NeuronConfig
Qwen3-VL-8B-Thinking PASS NeuronQwen3VLForCausalLM, Qwen3VLInferenceConfig, Qwen3VLNeuronConfig
biogpt PASS NeuronBioGptForCausalLM, BioGptInferenceConfig (title case confirmed)

Compilation Validation

I attempted end-to-end compile+generate on biogpt and Qwen3-VL-8B. Both hit pre-existing issues unrelated to the import fixes:

Model Compile Issue Related to Import Fix?
biogpt Compiled successfully (107.6s) Fails at load() -- update_state_dict_for_tied_weights not implemented No -- pre-existing missing method
Qwen3-VL-8B Fails at config validation Nested VL config not extracted properly by load_pretrained_config No -- pre-existing config handling issue

These contribs have deeper issues beyond the import paths. The import fixes in this PR are correct and verified -- they resolve the ModuleNotFoundError/ImportError that prevents the models from being used at all.

@jaharsh-aws
Copy link
Copy Markdown

Do you have the github issue link for the pre-existing bugs ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants