Skip to content

Commit 4076494

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Register nms and roi_align Autocast policy for PyTorch Intel GPU backend (#8541)
Summary: Signed-off-by: Feng Yuan <[email protected]> Differential Revision: D60903715 fbshipit-source-id: c0919c6b0473432b7ef7a30599c3dc143e3da1cf Co-authored-by: Nicolas Hug <[email protected]>
1 parent 850f45d commit 4076494

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

torchvision/csrc/ops/autocast/nms_kernel.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,12 @@ TORCH_LIBRARY_IMPL(torchvision, AutocastCPU, m) {
3838
(nms_autocast<c10::DispatchKey::AutocastCPU, c10::DeviceType::CPU>)));
3939
}
4040

41+
TORCH_LIBRARY_IMPL(torchvision, AutocastXPU, m) {
42+
m.impl(
43+
TORCH_SELECTIVE_NAME("torchvision::nms"),
44+
TORCH_FN(
45+
(nms_autocast<c10::DispatchKey::AutocastXPU, c10::DeviceType::XPU>)));
46+
}
47+
4148
} // namespace ops
4249
} // namespace vision

torchvision/csrc/ops/autocast/roi_align_kernel.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,13 @@ TORCH_LIBRARY_IMPL(torchvision, AutocastCPU, m) {
4848
c10::DeviceType::CPU>)));
4949
}
5050

51+
TORCH_LIBRARY_IMPL(torchvision, AutocastXPU, m) {
52+
m.impl(
53+
TORCH_SELECTIVE_NAME("torchvision::roi_align"),
54+
TORCH_FN((roi_align_autocast<
55+
c10::DispatchKey::AutocastXPU,
56+
c10::DeviceType::XPU>)));
57+
}
58+
5159
} // namespace ops
5260
} // namespace vision

0 commit comments

Comments
 (0)