Repository navigation
[https://nvbugs/7024242][fix] Scope the GLM-5.2 sm_103 tp8 accuracy engine's environment overrides - #22032
[https://nvbugs/7024242][fix] Scope the GLM-5.2 sm_103 tp8 accuracy engine's environment overrides#22032trtllm-agent wants to merge 1 commit into
Conversation
…ngine's environment overrides LLM writes env_overrides into the calling process's os.environ and does not restore them, so the modeling_v2 accuracy tests open each engine inside scoped_env_overrides, and test_modeling_v2_env_scope.py checks that every LLM(...) call under accuracy/modeling_v2 is built that way. TestModelingV2Glm52Nvfp4Sm103Tp8 passed env_overrides to an engine built outside such a scope, so TRTLLM_MODELING_V2_VALIDATE and TRTLLM_DSA_INDEXER_BF16 stayed set in the pytest process after the test, and the check fails on glm_moe_dsa/glm_5_2_nvfp4__sm_103__tp8/test_accuracy.py. The file-level waiver of this bug hid that failure; it was added when the check failed on test_minimax_m3.py, which NVIDIA#20623 has since scoped. Open the engine inside scoped_env_overrides and pass it the yielded mapping, as _env.py documents, and remove the waiver. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
|
No actionable comments were generated in the recent review. WalkthroughThe GLM-5.2 accuracy test now scopes rank environment overrides during ChangesGLM-5.2 environment scoping
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Merge Risk:
|
Dev Engineer Review
The GLM-5.2 test now scopes rank environment overrides while constructing
LLMand passes the yielded mapping asenv_overrides. This avoids leaving those overrides in the caller’s process environment after the test. The waiver fortest_modeling_v2_env_scope.pywas removed. No unrelated files changed.QA Engineer Review
The accuracy test changed its engine setup; its test ID did not change. The test-list change removes the waiver for
unittest/_torch/modeling_v2/test_modeling_v2_env_scope.py. The GLM-5.2 test is listed intests/integration/test_lists/test-db/l0_gb300_multi_nodes_node2_gpu8.yml. Coverage verdict: sufficient for the environment-scope correction. The full accuracy test was not rerun; reported stubbed checks do not establish end-to-end coverage.Per-File QA Perspective
tests/integration/defs/accuracy/modeling_v2/glm_moe_dsa/glm_5_2_nvfp4__sm_103__tp8/test_accuracy.py: The GSM8K TP8 test checks GLM-5.2 engine behavior with scoped environment overrides. It is listed in thetest-dbCI list.tests/integration/test_lists/waives.txt: Removes the environment-scope test waiver, allowing that test to run without this skip entry. This list change does not alter test functions or selectors.Description
LLMwritesenv_overridesinto the calling process'sos.environ(BaseLLM._process_env_overrides) and does not restore them. The modeling_v2 accuracy tests therefore open each engine insidescoped_env_overrides(tests/integration/defs/accuracy/modeling_v2/_env.py), andtests/unittest/_torch/modeling_v2/test_modeling_v2_env_scope.pychecks that everyLLM(...)call underaccuracy/modeling_v2/is built that way.TestModelingV2Glm52Nvfp4Sm103Tp8, added in #20524 and moved toglm_moe_dsa/glm_5_2_nvfp4__sm_103__tp8/test_accuracy.pyin #21603, passesenv_overridesto an engine built outside such a scope.TRTLLM_MODELING_V2_VALIDATEandTRTLLM_DSA_INDEXER_BF16therefore stay set in the pytest process after the test, and on main the check fails:CI does not report it because the whole check file is waived under https://nvbugs/7024242. That waiver was added when the check failed on
test_minimax_m3.py, whose engine #20623 has since scoped.This PR opens the GLM-5.2 sm_103 tp8 engine inside
scoped_env_overridesand passes it the yielded mapping, as_env.pydocuments, and removes the waiver.Fixes https://nvbugs/7024242
Test Coverage
unittest/_torch/modeling_v2/test_modeling_v2_env_scope.py, selected bytests/integration/test_lists/test-db/l0_cpu.ymlfor the CPU-Generic stages, covers this change. It was run on main and on this branch with the samewaives.txt(main's without the line this PR removes), in the CI image with a wheel built from main using thejenkins/Build.groovyx86_64 flags, and the CPU stage's pytest command line:test_accuracy_engines_are_inside_environment_scopes[glm_moe_dsa/glm_5_2_nvfp4__sm_103__tp8/test_accuracy.py]fails, the other 31 cases pass;l0_cpushard that holds the check (CPU-Generic-x86-2, 184 entries, one pytest process): main 1 failed (this check), 182 passed, 1 skipped; this PR 183 passed, 1 skipped (unittest/_torch/modeling, skipped bywaives.txtin both runs).TestModelingV2Glm52Nvfp4Sm103Tp8::test_gsm8k_tp8runs on 2x4 GB300 (l0_gb300_multi_nodes_node2_gpu8.yml) and was not rerun. With this change its module collects, and with the engine and the GSM8K task stubbed,_evaluatepasses the engine the same arguments as on main; the two variables are set while the engine is built, evaluated and closed, and are unset in the test process afterwards (on main they stay set).PR 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.