Skip to content

Commit e63476b

Browse files
nakuliyerpytorchmergebot
authored andcommitted
[MTIA Runtime] Add foreach_div ops to native_functions.yaml (pytorch#162732)
Summary: Quick fix for runtime support on foreach_div, see D81274963. Fixed an issue that I created in that diff so that the CIs pass. Test Plan: CIs created in D81274963 and D81286593 pass. Added some logs in [aten_mtia_ops.py](https://www.internalfb.com/code/fbsource/[c56272ba042c43c65517dcac254364cf732fcfa9]/fbcode/mtia/host_runtime/torch_mtia/aten_mtia_ops.cpp?lines=3676) to all the foreach_div ops. We can see that the correct MTIA kernels are being invoked in the tests. https://www.internalfb.com/intern/testinfra/testrun/15481123829281588 Rollback Plan: Pull Request resolved: pytorch#162732 Approved by: https://github.com/danielhou0515
1 parent 4f641aa commit e63476b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

aten/src/ATen/native/native_functions.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10699,13 +10699,15 @@
1069910699
dispatch:
1070010700
CompositeExplicitAutograd: foreach_tensor_div_list_kernel_slow
1070110701
CUDA: foreach_tensor_div_list_kernel_cuda
10702+
MTIA: foreach_tensor_div_list_kernel_mtia
1070210703

1070310704
- func: _foreach_div_.List(Tensor(a!)[] self, Tensor[] other) -> ()
1070410705
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
1070510706
variants: function
1070610707
dispatch:
1070710708
CompositeExplicitAutograd: foreach_tensor_div_list_kernel_slow_
1070810709
CUDA: foreach_tensor_div_list_kernel_cuda_
10710+
MTIA: foreach_tensor_div_list_kernel_mtia_
1070910711
autogen: _foreach_div.List_out
1071010712

1071110713
- func: _foreach_div.ScalarList(Tensor[] self, Scalar[] scalars) -> Tensor[]
@@ -10729,13 +10731,15 @@
1072910731
dispatch:
1073010732
CompositeExplicitAutograd: foreach_tensor_div_tensor_kernel_slow
1073110733
CUDA: foreach_tensor_div_tensor_kernel_cuda
10734+
MTIA: foreach_tensor_div_tensor_kernel_mtia
1073210735

1073310736
- func: _foreach_div_.Tensor(Tensor(a!)[] self, Tensor other) -> ()
1073410737
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
1073510738
variants: function
1073610739
dispatch:
1073710740
CompositeExplicitAutograd: foreach_tensor_div_tensor_kernel_slow_
1073810741
CUDA: foreach_tensor_div_tensor_kernel_cuda_
10742+
MTIA: foreach_tensor_div_tensor_kernel_mtia_
1073910743
autogen: _foreach_div.Tensor_out
1074010744

1074110745
- func: _foreach_clamp_max.Scalar(Tensor[] self, Scalar scalar) -> Tensor[]

0 commit comments

Comments
 (0)