Revert "CUDACachingHostAllocatorImpl skip event query during capture (#164001)"

This reverts commit 4cf29004749714670fee9e7e3776778faf5ced25.

Reverted https://github.com/pytorch/pytorch/pull/164001 on behalf of https://github.com/yangw-dev due to failed internal error with multiple errors found: Not equal to tolerance rtol=0.1, atol=0.1.. ([comment](https://github.com/pytorch/pytorch/pull/164001#issuecomment-3356894787))
This commit is contained in:
PyTorch MergeBot
2025-10-01 15:11:20 +00:00
parent 31681bcacc
commit 07d896fa48

View File

@ -151,11 +151,6 @@ struct CUDACachingHostAllocatorImpl
}
bool query_event(EventPool::Event& event) override {
// Do not call cudaEventQuery if capturing is underway
if (at::cuda::currentStreamCaptureStatusMayInitCtx() !=
at::cuda::CaptureStatus::None) {
return false;
}
cudaError_t err = cudaEventQuery(*event);
if (err == cudaErrorNotReady) {
(void)cudaGetLastError(); // clear CUDA error