Repository navigation
[https://nvbugs/6939212][fix] Unwaive unittest/_torch/attention after the KVCM2 teardown fix - #20471
Conversation
|
Tests should close KVCM2 deterministically and KVCM2 was design to work with existing cuda context. Capturing a cuda context is not a reliable fix. the user could have destroyed that context when GC happens. I think what needs to be fixed is the test:
|
|
I included a fix here: 1dc346c |
|
@lowsfer Thanks, agreed on both points:
What this PR established, for whoever lands the test fix (H100, base 6544bcd):
Your commit 1dc346c on #19650 fixes it at that source. #19650 is a perf PR, though, so NVBug 6939212 would stay open until it merges. Which do you prefer?
|
|
Please unwaive cases by searching "https://nvbugs/6948011" in waives.txt. |
|
#19650 is merged. I included it there because it blocked CI and is very small. but I didn't unwaive, so you still need this PR to do it. |
… the KVCM2 teardown fix The failures came from test_dsa_indexer leaving its KVCacheManagerV2 to the cyclic GC: freed on a thread without a CUDA context, its teardown failed with CUDA error 201 and poisoned KVCM2 for the rest of the process. NVIDIA#19650 now passes the cache manager to MockMetadata explicitly, so no closure keeps it alive, and the test owns its release. Remove the waiver for this bug. Signed-off-by: chenfeiz0326 <203214996+chenfeiz0326@users.noreply.github.com>
|
@lowsfer thanks for landing the test fix in #19650 (0cd9d0b). I'm reworking this PR as you suggest: drop the CUDA-context capture entirely and carry only the waiver removal for https://nvbugs/6939212 ( @HuiGao-NV main has no The reworked commit has not been pushed yet. It still goes through the bot's review, then H100 verification on a main build that includes #19650, before it replaces this PR's head. |
615673e to
b8b0b02
Compare
|
This PR now contains only the unwaive. The CUDA-context capture is dropped, as @lowsfer asked: the root cause is fixed on main by #19650, where Change: removes Verified on H100 with main 0372799 plus this change, using a post-merge wheel that contains #19650:
@HuiGao-NV: no waiver line references https://nvbugs/6948011 on main, so there is nothing to remove for it. Its reported error is the same /bot run follows. |
|
/bot run --disable-fail-fast |
|
PR_Github #78837 [ run ] triggered by Bot. Commit: |
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
|
PR_Github #78837 [ run ] completed with state |
Summary
Removes this bug's waiver for
unittest/_torch/attention. The failure it covered is fixed on main by #19650.Fixes https://nvbugs/6939212
Root cause (fixed on main by #19650)
test_dsa_indexer's test-localMockMetadata.__init__capturedcache_managerin a closure. A class object is always part of a reference cycle, so theKVCacheManagerV2outlived the test and was freed later by the cyclic GC, on whichever thread triggered the collection.~KvCache→close()→cuEventRecord) then failed withCUDA driver error: 201 (invalid device context)and poisoned KVCM2 for the rest of the process, so every later V2 test failed withCorruptedError.cache_managertoMockMetadata.__init__as a parameter, so no closure keeps the manager alive and it is released on the test's own thread.Change
tests/integration/test_lists/waives.txt: removesunittest/_torch/attention --ignore=unittest/_torch/attention/sparse/test_cute_dsl_gvr_topk_decode.py --ignore=unittest/_torch/attention/sparse/msa/test_minimax_m3_sparse_attn_decode.py SKIP (https://nvbugs/6939212).Verification (H100, main 0372799 + this change, post-merge wheel containing #19650, CI image)
test_dsa_indexercase,gc.collect()on a thread without a CUDA context, then the next case (poisoned KVCM2 with error 201 before #19650)unittest/_torch/attention(with both--ignores) viatest_unittests_v2, as CI runs itThe run had one failure:
test_cute_dsl_mla.py::test_mla_generation_routes_wide_head_fp8_verify_away_from_trtllm_gen[103-96-1-True-False-cute_dsl_mla]. It is unrelated and already waived on main for https://nvbugs/6948129; the local run did not apply the waiver list.🤖 Generated with Claude Code
Dev Engineer Review
The change removes the
unittest/_torch/attentionwaiver for NVBug 6939212. The scope is limited to the test waiver list. The reported fix is in#19650; this change does not modify test code.QA Engineer Review
tests/integration/test_lists/waives.txtremoves the waiver that excluded sparse-attention tests. The author reports 3932 tests passed and one failure that they attribute to a separate test already waived on main. The author has not separately run thetest_cutedsl_mqa_logits_output_buffer_persistentcase associated with NVBug 6948011. Coverage verdict: needs follow-up.Per-File QA Perspective
tests/integration/test_lists/waives.txt: Removing the waiver allows the affected attention tests to run instead of being skipped. Verify the tests pass with the#19650fix; the separate NVBug 6948011 case remains unverified.