[release/2.12] Cleanup persistent cuBLASLt workspaces before test_mempool_ctx_multithread#3372
Merged
pragupta merged 1 commit intoJun 24, 2026
Conversation
…hread `test_cuda.py::TestMemPool::test_mempool_ctx_multithread` assumes the device allocator snapshot is empty after empty_cache(), but earlier tests in the same process can leave inactive segments behind. Call `torch._C._cuda_clearCublasWorkspaces()` at the start of the test (before empty_cache()) so prior tests do not pollute the initial segment count. This matches the pattern already used in other tests Reproducer (fails without the fix): ```bash python test_cuda.py TestCuda.test_matmul_device_mismatch TestMemPool.test_mempool_ctx_multithread ``` test_matmul_device_mismatch leaves reserved segments. test_mempool_ctx_multithread then fails with `Expected 0 but got N` on the opening assertion. The test passes in isolation. Fixes pytorch#153460 Pull Request resolved: pytorch#187991 Approved by: https://github.com/jeffdaily (cherry picked from commit 77fa1dc)
|
Jenkins build for 3ab4141b2653b55e4c341037a279ce087e31f7b3 commit is in progress |
Author
|
!cherry-pick --onto release/2.11 release/2.10 |
rocm-repo-management-api-6 Bot
added a commit
that referenced
this pull request
Jun 24, 2026
…hread Cherry-pick of #3372 Co-authored-by: Dmitry Nikolaev <139769634+dnikolaev-amd@users.noreply.github.com>
rocm-repo-management-api-6 Bot
added a commit
that referenced
this pull request
Jun 24, 2026
…hread Cherry-pick of #3372 Co-authored-by: Dmitry Nikolaev <139769634+dnikolaev-amd@users.noreply.github.com>
|
Created branch autogenerated/release/2.11_cherry-pick_pr-3372 and #3373 Created branch autogenerated/release/2.10_cherry-pick_pr-3372 and #3374 Comment processed by Build |
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.
test_cuda.py::TestMemPool::test_mempool_ctx_multithreadassumes the device allocator snapshot is empty after empty_cache(), but earlier tests in the same process can leave inactive segments behind.Call
torch._C._cuda_clearCublasWorkspaces()at the start of the test (before empty_cache()) so prior tests do not pollute the initial segment count. This matches the pattern already used in other testsReproducer (fails without the fix):
test_matmul_device_mismatch leaves reserved segments. test_mempool_ctx_multithread then fails with
Expected 0 but got Non the opening assertion. The test passes in isolation.Fixes pytorch#153460 Pull Request resolved: pytorch#187991 Approved by: https://github.com/jeffdaily
(cherry picked from commit 77fa1dc)
Cherry-picked to release/2.11 branch via #3373
Cherry-picked to release/2.10 branch via #3374