Repository navigation
Conversation
… capturing This matches the behavior of CUDACachingAllocator.cpp. If a user wants to prevent a pin_memory() call from a data loading thread from disrupting their stream capture, they use "thread_local" stream caputre mode for that stream capture.
This PR needs a
|
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/174724
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit b190451 with merge base c24b6a2 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ngimel
left a comment
There was a problem hiding this comment.
Let's try this, if someone complains we can try a weaker version with checking captures_underway.empty() that should work even with global capture mode.
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / linux-jammy-rocm-py3.10 / test (default, 5, 6, linux.rocm.gpu.gfx950.1) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: trunk / linux-jammy-rocm-py3.10 / test (default, 5, 6, linux.rocm.gpu.gfx950.1) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ng captures cudaHostAlloc and cudaHostRegister ran in relaxed capture mode unconditionally. They now do so only while a capture is registered with the allocator, like the event query (the captures_underway check from pytorch#174724). That still covers what main's current-stream check does not: inside a HostMemPool context, a capture begun on this thread takes only the capturing stream, so an allocation on another stream goes to the pool, and allocating a block or querying a block's event there runs on the capturing thread while its current stream is not capturing. Frees stay relaxed unconditionally (pytorch#200733). Test Plan: test_side_stream_alloc_during_global_capture allocates on a side stream from the routed pool during a global-mode capture, querying a pending event and allocating a new block, in both pinned_use_cuda_host_register modes. With main's current-stream check instead, both cases fail with cudaErrorStreamCaptureUnsupported and invalidate the capture. ```bash python -m pytest test/test_cuda.py -k test_side_stream_alloc_during_global_capture ``` Authored with assistance from Claude Code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng captures cudaHostAlloc and cudaHostRegister ran in relaxed capture mode unconditionally. They now do so only while a capture is registered with the allocator, like the event query (the captures_underway check from pytorch#174724). That still covers what main's current-stream check does not: inside a HostMemPool context, a capture begun on this thread takes only the capturing stream, so an allocation on another stream goes to the pool, and allocating a block or querying a block's event there runs on the capturing thread while its current stream is not capturing. Frees stay relaxed unconditionally (pytorch#200733). Test Plan: test_side_stream_alloc_during_global_capture allocates on a side stream from the routed pool during a global-mode capture, querying a pending event and allocating a new block, in both pinned_use_cuda_host_register modes. With main's current-stream check instead, both cases fail with cudaErrorStreamCaptureUnsupported and invalidate the capture. ```bash python -m pytest test/test_cuda.py -k test_side_stream_alloc_during_global_capture ``` Authored with assistance from Claude Code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This matches the behavior of CUDACachingAllocator.cpp.
If a user wants to prevent a pin_memory() call from a data loading thread from disrupting their stream capture, they use "thread_local" stream caputre mode for that stream capture.
Requested by @ngimel as a follow up to #167507