Disable background threads for XPU host allocator (#161242)

# Motivation
https://github.com/pytorch/pytorch/pull/160505 enables background threads for XPU host allocator. However, it will hang on Windows during program exit. Now disable it until we narrow down the issue.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/161242
Approved by: https://github.com/EikanWang
This commit is contained in:
Yu, Guangye
2025-08-22 11:05:47 +00:00
committed by PyTorch MergeBot
parent 595987d28d
commit 373e25c2eb

View File

@ -30,6 +30,12 @@ struct XPUCachingHostAllocatorImpl
bool query_event(XPUEvent& event) override {
return event.query();
}
bool pinned_use_background_threads() override {
// Using background threads for XPU causes a hang on Windows during program
// exit. Will be enabled once the issue is resolved.
return false;
}
};
DECLARE_HOST_ALLOCATOR(