intel / torch-xpu-ops

Apache License 2.0
30 stars 21 forks source link

Add channel_shuffle #960

Closed CuiYifeng closed 1 month ago

CuiYifeng commented 1 month ago
CuiYifeng commented 1 month ago

CUDA also dispatch channel_shuffle to CPU.

xytintel commented 1 month ago

Why no kernel there?

CuiYifeng commented 1 month ago

Why no kernel there?

CUDA channel_shuffle is also dispatched to CPU implementation. We just need to reuse CPU channel_shuffle unless there are performance. https://github.com/pytorch/pytorch/blob/main/aten/src/ATen/native/native_functions.yaml#L4546

xytintel commented 1 month ago

Pls add nn.functional.channel_shuffle to the test infra and paste the testing log in comments.

CuiYifeng commented 1 month ago

test/xpu/test_ops_xpu.py::TestCommonXPU::test_compare_cpurefs_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_compare_cpu_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_dtypesrefs_nn_functional_channel_shuffle_xpu PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_dtypes_nn_functional_channel_shuffle_xpu PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_multiple_devices_nn_functional_channel_shuffle_xpu_float32 SKIPPED (fewer than 2 devices detected) test/xpu/test_ops_xpu.py::TestCommonXPU::test_multiple_devices_nn_functional_channel_shuffle_xpu_int64 SKIPPED (fewer than 2 devices detected) test/xpu/test_ops_xpu.py::TestCommonXPU::test_non_standard_bool_values_nn_functional_channel_shuffle_xpu_bool PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_noncontiguous_samples_nn_functional_channel_shuffle_xpu_complex64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_noncontiguous_samples_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_noncontiguous_samples_nn_functional_channel_shuffle_xpu_int64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_outrefs_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_out_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_out_warningrefs_nn_functional_channel_shuffle_xpu PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_out_warning_nn_functional_channel_shuffle_xpu PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_bfloat16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_bool PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_complex128 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_complex64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_float16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_float64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_int16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_int32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_int64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_int8 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_refrefs_nn_functional_channel_shuffle_xpu_uint8 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executorrefs_nn_functional_channel_shuffle_executor_aten_xpu_bfloat16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executor__refs_nn_functional_channel_shuffle_executor_aten_xpu_bool PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executorrefs_nn_functional_channel_shuffle_executor_aten_xpu_complex128 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executorrefs_nn_functional_channel_shuffle_executor_aten_xpu_complex64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executor__refs_nn_functional_channel_shuffle_executor_aten_xpu_float16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executorrefs_nn_functional_channel_shuffle_executor_aten_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executorrefs_nn_functional_channel_shuffle_executor_aten_xpu_float64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executor__refs_nn_functional_channel_shuffle_executor_aten_xpu_int16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executorrefs_nn_functional_channel_shuffle_executor_aten_xpu_int32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executorrefs_nn_functional_channel_shuffle_executor_aten_xpu_int64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executor__refs_nn_functional_channel_shuffle_executor_aten_xpu_int8 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_executorrefs_nn_functional_channel_shuffle_executor_aten_xpu_uint8 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_metarefs_nn_functional_channel_shuffle_xpu_bfloat16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_meta__refs_nn_functional_channel_shuffle_xpu_bool PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_metarefs_nn_functional_channel_shuffle_xpu_complex128 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_metarefs_nn_functional_channel_shuffle_xpu_complex64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_meta__refs_nn_functional_channel_shuffle_xpu_float16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_metarefs_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_metarefs_nn_functional_channel_shuffle_xpu_float64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_meta__refs_nn_functional_channel_shuffle_xpu_int16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_metarefs_nn_functional_channel_shuffle_xpu_int32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_metarefs_nn_functional_channel_shuffle_xpu_int64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_meta__refs_nn_functional_channel_shuffle_xpu_int8 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_metarefs_nn_functional_channel_shuffle_xpu_uint8 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_bfloat16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_bool PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_complex128 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_complex64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_float16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_float64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_int16 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_int32 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_int64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_int8 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_python_ref_torch_fallbackrefs_nn_functional_channel_shuffle_xpu_uint8 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_variant_consistency_eager_nn_functional_channel_shuffle_xpu_complex64 PASSED test/xpu/test_ops_xpu.py::TestCommonXPU::test_variant_consistency_eager_nn_functional_channel_shuffle_xpu_float32 PASSED test/xpu/test_ops_xpu.py::TestMathBitsXPU::test_conj_viewrefs_nn_functional_channel_shuffle_xpu_complex64 PASSED test/xpu/test_ops_xpu.py::TestMathBitsXPU::test_conj_view_nn_functional_channel_shuffle_xpu_complex64 PASSED test/xpu/test_ops_xpu.py::TestMathBitsXPU::test_neg_conj_view__refs_nn_functional_channel_shuffle_xpu_complex128 PASSED test/xpu/test_ops_xpu.py::TestMathBitsXPU::test_neg_conj_view_nn_functional_channel_shuffle_xpu_complex128 PASSED test/xpu/test_ops_xpu.py::TestMathBitsXPU::test_neg_viewrefs_nn_functional_channel_shuffle_xpu_float64 PASSED test/xpu/test_ops_xpu.py::TestMathBitsXPU::test_neg_view_nn_functional_channel_shuffle_xpu_float64 PASSED

====================================================================== 68 passed, 2 skipped, 16286 deselected in 5.66s ======================================================================