Skip to content

torch/sparse/_triton_ops*.py need to be ported to enable for Intel GPU for test_sparse and test_sparse_csr cases #2246

@wincent8

Description

@wincent8

🐛 Describe the bug

Cases:
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_kernel_op_bsr_dense_addmm_blocksize_16_out_dtype_unspecified_xpu_float32
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_kernel_op_bsr_dense_addmm_blocksize_16x32_out_dtype_unspecified_xpu_float32
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_kernel_op_bsr_dense_addmm_blocksize_32_out_dtype_unspecified_xpu_float32
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op__int_bsr_dense_addmm_out_dtype_unspecified_xpu_bfloat16
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op__int_bsr_dense_addmm_out_dtype_unspecified_xpu_float16
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op__int_bsr_dense_addmm_out_dtype_unspecified_xpu_float32
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op__int_bsr_dense_addmm_out_dtype_unspecified_xpu_int8
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op_bsr_dense_addmm_out_dtype_int32_xpu_int8
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op_bsr_dense_addmm_out_dtype_unspecified_xpu_bfloat16
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op_bsr_dense_addmm_out_dtype_unspecified_xpu_float16
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op_bsr_dense_addmm_out_dtype_unspecified_xpu_float32
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_tune_op_bsr_dense_addmm_out_dtype_unspecified_xpu_int8
op_ut,third_party.torch-xpu-ops.test.xpu.test_sparse_csr_xpu.TestSparseCompressedTritonKernelsXPU,test_triton_bsr_dense_bmm_error_messages_xpu_float16

_____________________________________ TestSparseCompressedTritonKernelsXPU.test_triton_tune_op_bsr_dense_addmm_out_dtype_unspecified_xpu_int8 _____________________________________
Traceback (most recent call last):
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/unittest/case.py", line 591, in run
    self._callTestMethod(testMethod)
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
    method()
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3293, in wrapper
    method(*args, **kwargs)
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/site-packages/torch/testing/_internal/common_device_type.py", line 428, in instantiated_test
    result = test(self, **param_kwargs)
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/site-packages/torch/testing/_internal/common_device_type.py", line 1435, in only_fn
    return fn(slf, *args, **kwargs)
  File "/home/sdp/wliao2/pytorch_backup/test/test_sparse_csr.py", line 4296, in test_triton_tune
    meta = tuner(*args, **dict(store=True, verbose=False, out=out))
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/site-packages/torch/sparse/_triton_ops_meta.py", line 665, in tune_bsr_dense_addmm
    initial_meta = get_meta(opname, key, version=version, exact=True)
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/site-packages/torch/sparse/_triton_ops_meta.py", line 141, in get_meta
    device_name = torch.cuda.get_device_name()
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/site-packages/torch/cuda/__init__.py", line 586, in get_device_name
    return get_device_properties(device).name
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/site-packages/torch/cuda/__init__.py", line 619, in get_device_properties
    _lazy_init()  # will define _get_device_properties
  File "/home/sdp/miniforge-pypy3/envs/wliao2/lib/python3.10/site-packages/torch/cuda/__init__.py", line 404, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

To execute this test, run the following from the base repo dir:
    python test/test_sparse_csr.py TestSparseCompressedTritonKernelsXPU.test_triton_tune_op_bsr_dense_addmm_out_dtype_unspecified_xpu_int8

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

Versions

Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Ubuntu 24.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-9ubuntu1) 11.4.0
Clang version: 18.1.3 (1ubuntu1)
CMake version: Could not collect
Libc version: glibc-2.39

Python version: 3.10.0 | packaged by conda-forge | (default, Nov 20 2021, 02:24:10) [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-6.8.0-38-generic-x86_64-with-glibc2.39
Is CUDA available: N/A
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Could not collect
Is XPU available: N/A
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 57 bits virtual
Byte Order: Little Endian
CPU(s): 224
On-line CPU(s) list: 0-223
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) Platinum 8480+
CPU family: 6
Model: 143
Thread(s) per core: 2
Core(s) per socket: 56
Socket(s): 2
Stepping: 6
CPU(s) scaling MHz: 100%
CPU max MHz: 3800.0000
CPU min MHz: 800.0000
BogoMIPS: 4000.00
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 5.3 MiB (112 instances)
L1i cache: 3.5 MiB (112 instances)
L2 cache: 224 MiB (112 instances)
L3 cache: 210 MiB (2 instances)
NUMA node(s): 2
NUMA node0 CPU(s): 0-55,112-167
NUMA node1 CPU(s): 56-111,168-223
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

Versions of relevant libraries:
[pip3] dpcpp-cpp-rt==2025.2.1
[pip3] flake8==7.3.0
[pip3] flake8-bugbear==24.12.12
[pip3] flake8-comprehensions==3.16.0
[pip3] flake8-executable==2.1.3
[pip3] flake8-logging-format==2024.24.12
[pip3] flake8-pyi==25.5.0
[pip3] flake8_simplify==0.22.0
[pip3] impi-rt==2021.16.1
[pip3] intel-cmplr-lib-rt==2025.2.1
[pip3] intel-cmplr-lib-ur==2025.2.1
[pip3] intel-cmplr-lic-rt==2025.2.1
[pip3] intel-opencl-rt==2025.2.1
[pip3] intel-openmp==2025.2.1
[pip3] intel-pti==0.13.1
[pip3] intel-sycl-rt==2025.2.1
[pip3] mkl==2025.2.0
[pip3] mypy==1.16.0
[pip3] mypy_extensions==1.1.0
[pip3] numpy==1.26.4
[pip3] oneccl==2021.16.1
[pip3] oneccl-devel==2021.16.1
[pip3] onemkl-sycl-blas==2025.2.0
[pip3] onemkl-sycl-dft==2025.2.0
[pip3] onemkl-sycl-lapack==2025.2.0
[pip3] onemkl-sycl-rng==2025.2.0
[pip3] onemkl-sycl-sparse==2025.2.0
[pip3] optree==0.17.0
[pip3] pytorch-triton-xpu==3.5.0+git1b0418a9
[pip3] tbb==2022.2.0
[pip3] tcmlib==1.4.0
[pip3] torch==2.10.0.dev20251022+xpu
[pip3] umf==0.11.0
[conda] dpcpp-cpp-rt 2025.2.1 pypi_0 pypi
[conda] impi-rt 2021.16.1 pypi_0 pypi
[conda] intel-cmplr-lib-rt 2025.2.1 pypi_0 pypi
[conda] intel-cmplr-lib-ur 2025.2.1 pypi_0 pypi
[conda] intel-cmplr-lic-rt 2025.2.1 pypi_0 pypi
[conda] intel-opencl-rt 2025.2.1 pypi_0 pypi
[conda] intel-openmp 2025.2.1 pypi_0 pypi
[conda] intel-pti 0.13.1 pypi_0 pypi
[conda] intel-sycl-rt 2025.2.1 pypi_0 pypi
[conda] mkl 2025.2.0 pypi_0 pypi
[conda] numpy 1.26.4 pypi_0 pypi
[conda] oneccl 2021.16.1 pypi_0 pypi
[conda] oneccl-devel 2021.16.1 pypi_0 pypi
[conda] onemkl-sycl-blas 2025.2.0 pypi_0 pypi
[conda] onemkl-sycl-dft 2025.2.0 pypi_0 pypi
[conda] onemkl-sycl-lapack 2025.2.0 pypi_0 pypi
[conda] onemkl-sycl-rng 2025.2.0 pypi_0 pypi
[conda] onemkl-sycl-sparse 2025.2.0 pypi_0 pypi
[conda] optree 0.17.0 pypi_0 pypi
[conda] pytorch-triton-xpu 3.5.0+git1b0418a9 pypi_0 pypi
[conda] tbb 2022.2.0 pypi_0 pypi
[conda] tcmlib 1.4.0 pypi_0 pypi
[conda] torch 2.10.0.dev20251022+xpu pypi_0 pypi
[conda] torchfix 0.4.0 pypi_0 pypi
[conda] umf 0.11.0 pypi_0 pypi

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions