Skip to content

[riscv64][test]inductor/test_extension_backend.py::ExtensionBackendTests::test_open_device_registration #13

@XYenChi

Description

@XYenChi

🐛 Describe the bug

python test/inductor/test_extension_backend.py
fail log:

======================================================================
ERROR: test_open_device_registration (__main__.ExtensionBackendTests.test_open_device_registration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/chenyixuan/pytorch/torch/testing/_internal/common_utils.py", line 3370, in wrapper
    method(*args, **kwargs)
  File "/home/chenyixuan/pytorch/torch/testing/_internal/common_utils.py", line 2174, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/test/inductor/test_extension_backend.py", line 162, in test_open_device_registration
    _, code = run_and_get_cpp_code(opt_fn, x, y, z)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_inductor/utils.py", line 3350, in run_and_get_cpp_code
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/eval_frame.py", line 1020, in compile_wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 2340, in __call__
    result = self._torchdynamo_orig_backend(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 2076, in __call__
    result = self._inner_convert(
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 727, in __call__
    result = _compile(
             ^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 1915, in _compile
    raise InternalTorchDynamoError(
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 1851, in _compile
    guarded_code, tracer_output = compile_inner(code, one_graph, hooks)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_utils_internal.py", line 96, in wrapper_function
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 1495, in compile_inner
    return _compile_inner(code, one_graph, hooks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 1540, in _compile_inner
    dynamo_output = compile_frame(
                    ^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 1403, in compile_frame
    bytecode, tracer_output = transform_code_object(code, transform)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/bytecode_transformation.py", line 1626, in transform_code_object
    tracer_output = transformations(instructions, code_options)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 1375, in transform
    tracer_output = trace_frame(
                    ^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 341, in _fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/convert_frame.py", line 818, in trace_frame
    tracer = InstructionTranslator(
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/symbolic_convert.py", line 4830, in __init__
    self.symbolic_stream_state = SymbolicStreamState()
                                 ^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/_dynamo/variables/streams.py", line 215, in __init__
    if torch.accelerator.is_available():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chenyixuan/pytorch/torch/accelerator/__init__.py", line 95, in is_available
    return mod.is_available()
           ^^^^^^^^^^^^^^^^
torch._dynamo.exc.InternalTorchDynamoError: AttributeError: module 'extension_device' has no attribute 'is_available'

Set TORCHDYNAMO_VERBOSE=1 for the internal stack trace (please do this especially if you're reporting a bug to PyTorch). For even more developer context, set TORCH_LOGS="+dynamo"


To execute this test, run the following from the base repo dir:
    python test/inductor/test_extension_backend.py ExtensionBackendTests.test_open_device_registration

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

----------------------------------------------------------------------
Ran 1 test in 127.468s

FAILED (errors=1)

Versions

PyTorch version: 2.12.0a0+git6bf8e49
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: openEuler 24.03 (LTS-SP2) (riscv64)
GCC version: (GCC) 12.3.1 (openEuler 12.3.1-93.oe2403sp2)
Clang version: 17.0.6 ( 17.0.6-41.oe2403sp2)
CMake version: version 4.2.1
Libc version: glibc-2.38

Python version: 3.11.6 (main, Jun 16 2025, 09:12:31) [GCC 12.3.1 (openEuler 12.3.1-93.oe2403sp2)] (64-bit runtime)
Python platform: Linux-6.18.2-pkg1.oemulti-riscv64-with-glibc2.38
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False
Caching allocator config: N/A

CPU:
Architecture: riscv64
Byte Order: Little Endian
CPU(s): 64
On-line CPU(s) list: 0-63
Model name: -
Thread(s) per core: 1
Core(s) per socket: 64
Socket(s): 1
L1d cache: 4 MiB (64 instances)
L1i cache: 4 MiB (64 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 64 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-63
Vulnerability Gather data sampling: Not affected
Vulnerability Ghostwrite: Not affected
Vulnerability Indirect target selection: 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 Old microcode: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1: Not affected
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected

Versions of relevant libraries:
[pip3] numpy==2.4.2
[pip3] optree==0.19.0
[pip3] torch==2.12.0a0+git6bf8e49
[conda] Could not collect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions