Repository navigation
[None][test] Add coverage for MiniMaxM3SparseForConditionalGeneration - #22172
StanleySun639 wants to merge 2 commits into
Conversation
Signed-off-by: Stanley Sun <stsun@nvidia.com>
|
No actionable comments were generated in the recent review. WalkthroughThe change adds a CUDA-gated test for registered MiniMax M3 text-only conditional generation. The test checks model construction, attention backend selection, token IDs, and forward outputs. The B200 pre-merge PyTorch test list now includes this test. ChangesMiniMax M3 text-only forward test
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk:
|
Keep the conditional-generation registry import alongside upstream quantization helpers, preserving the original forward test and B200 test-list entry. Signed-off-by: Stanley Sun <stsun@nvidia.com>
|
/bot run |
|
PR_Github #84409 [ run ] triggered by Bot. Commit: |
Dev Engineer Review
metadata.kv_cache_params.use_cache,metadata.kv_cache_manager,model.mm_token_ids, andmodel.model.layers[0].self_attn.attn. A refactor of these internals can break the test without a behavior regression.TrtllmAttentionandTrtllmAttentionMetadatafrom the TRT-LLM attention backend. A rename or move of these classes breaks the test at import time.model.lm_head(model.model.norm(embeddings)). The assertion only shows that outputs differ. It does not show how the decoder contributes.logits[-1]). Other positions are not checked.max_num_requests=1, one context request (num_contexts=1,seq_lens=[3]), and KV caching disabled. Multi-request batches and the KV-cache-enabled path are not exercised.atol=1e-2, rtol=1e-2. The test sets weights with a fixed seed, but these tolerances may need adjustment on other GPUs or kernels.QA Engineer Review
Test files and test-list files changed:
tests/unittest/_torch/models/test_minimax_m3.py: addstest_registered_conditional_generation_text_forward(+126/-0). The test is markedgpu, skipped without CUDA, and decorated withtorch.inference_mode().tests/integration/test_lists/test-db/l0_b200.yml: addsunittest/_torch/models/test_minimax_m3.py::test_registered_conditional_generation_text_forwardto the B200 pre-merge list (+1).Behavior covered by the new test:
MiniMaxM3SparseForConditionalGenerationresolves toMiniMaxM3VLForConditionalGeneration.vision_tower is None) and one decoder layer.TrtllmAttention.mm_token_idsequals[62, 63].(3, vocab_size), dtype float32, and are finite on CUDA.Not covered:
Test pass status: not available from the supplied evidence. The PR description reports Jenkins run
#137asSUCCESS. That report is not verified here.Coverage verdict:
sufficientfor the stated text-only forward scope. Follow-up for batched and KV-cache paths is optional.Per-File QA Perspective
tests/unittest/_torch/models/test_minimax_m3.py: New CUDA-gated test for text-only registration and forward behavior. Verify that thegpumarker selects it on B200 runners.tests/integration/test_lists/test-db/l0_b200.yml: Adds the new test ID to the B200 pre-merge list. The test ID matches the function name. No other entries changed.Description
Adds unit-test coverage for existing supported model architectures.
tests/unittest/_torch/models/test_minimax_m3.py::test_registered_conditional_generation_text_forwardverifies: The exact architecture registration resolves to MiniMaxM3VLForConditionalGeneration, and construction produces that wrapper with one real decoder layer, no vision tower, and the configured in-range multimodal token IDs. The constructed dense attention uses native TrtllmAttention, and prepared context metadata disables KV caching. Real wrapper forward returns finite CUDA float32 context logits with the configured token and vocabulary dimensions. Token-ID and explicit-embedding wrapper forwards agree numerically; the embedding call supplies no token IDs, so falling back to token lookup cannot satisfy the comparison. Wrapper logits differ from a separately computed decoder-bypassed embedding/norm/LM-head baseline. Changing only the first prompt token produces finite logits and changes the final token's logits despite leaving its own token ID unchanged.Test Coverage
unittest/_torch/models/test_minimax_m3.py::test_registered_conditional_generation_text_forwardSUCCESSGap Fixer Validation
461580bcd5adPR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.