spectrometerHBH opened a new pull request, #20233: URL: https://github.com/apache/tvm/pull/20233
## Summary - preserve the caller's current CUDA device while freeing device allocations and streams - preserve the worker's current CUDA device while releasing pooled Disco CUDA IPC allocations, including exceptional paths - add multi-GPU regressions for NDArray garbage collection and stream destruction - skip the three default `fast_topk_clusters` correctness cases because the FlashInfer reference omits an input bounds check and does not initialize or reset its shared threshold bin; strict registry import coverage remains enabled This follows #20213, which fixed the same ambient-device leak in CUDA module destruction. The remaining cleanup paths could still run from Python GC or runtime-object destructors and leave the thread on the resource's device. A later CuTeDSL DLPack export would then observe the wrong current device even though CuTeDSL itself had not changed it. The fix is kept in the runtime cleanup paths instead of adding repeated `torch.cuda.set_device` calls around references. ## Testing - `pre-commit run --files src/backend/cuda/runtime/cuda_device_api.cc src/runtime/extra/disco/cuda_ipc/cuda_ipc_memory.cc tests/python/tirx/codegen/test_codegen_cuda.py tests/python/tirx/test_tirx_kernels_registry_correctness.py` - `cmake --build build --parallel` - `python -m tirx_kernels.bench_suite --check-imports` - `python -m tirx_kernels.registry --cc 10 --strict` - targeted cleanup regressions: 3 passed - targeted Fast Top-K selection: 3 skipped - `python -m pytest tests/python/tirx/ -n 16`: 2902 passed, 94 skipped, 3 xpassed on three Blackwell GPUs - manual two-session CUDA IPC pool cleanup: the caller remained on `cuda:1` after releasing a pooled `cuda:0` allocation -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
