[test] test: add model contract matrix#4376
Open
yaoyu-33 wants to merge 2 commits into
Open
Conversation
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
|
Light Code Review - LGTM. All referenced symbols exist. No critical bugs. Minor: test accesses bridge._model_bridge (private attr). Suggested test cases: No perf tests impacted. |
Contributor
|
Detailed notes: (1) bridge._model_bridge (line 261) is a private attribute - if renamed, this test breaks. Consider exposing the resolved bridge type via a public property on AutoBridge. (2) _make_mimo_v2_flash_config() and _make_nemotron_labs_diffusion_config() use bare PretrainedConfig rather than model-specific config classes. This works because AutoBridge.supports() only checks the architectures field, but does not exercise any custom config validation. Acceptable for a contract test but worth documenting in the follow-ups. |
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 73bd639 |
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.
Summary
Starts the MB-544 P0 TODO #1 implementation by adding a shared config-only AutoBridge/provider contract matrix for a small high-risk slice.
Covered cases:
thinker_config.audio_config.d_modelexport reconstruction coverage for the NVBug 6314636 class of failure. The test also checks the thinker config run-config serialization hook.v_head_dim,window_size, andmtp_num_layers=0. This does not cover FP8 dequant, weight conversion, MTP weight mapping, or runtime execution.text_configprovider construction for hidden/FFN size, layer count, vocab, tied embeddings,rotary_base, and retainedhf_config. This does not cover diffusion runtime, conversion/export roundtrip, or the lazy config monkeypatch path.llm_configprovider construction for the cheap high-risk VLM onboarding path: hidden/FFN size, attention/query groups, vocab/sequence length, vocab divisor, and provider flags.The test stays unit-only and does not download weights or instantiate distributed models. It exercises AutoBridge support, registered bridge resolution, and
to_megatron_provider(load_weights=False)provider construction. New cases should be onboarded by adding a tiny HF config factory, real architecture string, bridge/provider symbols, provider-field assertions, and a focused extra assertion documenting the exact boundary.Validation
Passed:
ruff check tests/unit_tests/models/test_model_contract_matrix.py src/megatron/bridge/models/conversion/utils.py src/megatron/bridge/models/qwen3_asr/hf_qwen3_asr/configuration_qwen3_asr.pyruff format --check tests/unit_tests/models/test_model_contract_matrix.py src/megatron/bridge/models/conversion/utils.py src/megatron/bridge/models/qwen3_asr/hf_qwen3_asr/configuration_qwen3_asr.pygit diff --check/usr/bin/python3 -m py_compile tests/unit_tests/models/test_model_contract_matrix.py src/megatron/bridge/models/conversion/utils.py src/megatron/bridge/models/qwen3_asr/hf_qwen3_asr/configuration_qwen3_asr.pyuv sync --group test && uv run --no-sync python -m pytest tests/unit_tests/models/test_model_contract_matrix.py -q->5 passed, 28 warningsuv sync --group dev && uv run --no-sync pre-commit run --all-files-> all hooks passedRegression proof:
audio_config.d_model=1280; patched recursive reconstruction preservesaudio_config.d_model=1024.Local workstation note:
uv run ...remains blocked before test execution because the platform cannot install the pinnednvidia-resiliency-ext==0.6.0wheel. The focused pytest and all-files pre-commit checks above were run in the dependency-complete remote container instead.Remaining MB-544 P0 follow-ups
Linear: MB-544