Cambricon / triton-linalg

Development repository for the Triton-Linalg conversion
Apache License 2.0
131 stars 10 forks source link

error when runing tutorials: `01-vector-add.py` in triton-linalg/triton/python #11

Closed lordrebel closed 2 months ago

lordrebel commented 2 months ago

hi,
i build triton-linalg base on the readme successfully,but when i try to run the 01-vector-add.py in triton-linalg/triton/python, got the error:


(triton_linalg) root@31d7a76feafa:/workspace/projs/triton-linalg/triton/python/tutorials# python3 01-vector-add.py 
Traceback (most recent call last):
  File "/workspace/projs/triton-linalg/triton/python/tutorials/01-vector-add.py", line 23, in <module>
    import triton
  File "/workspace/projs/triton-linalg/triton/python/triton/__init__.py", line 8, in <module>
    from .runtime import (
  File "/workspace/projs/triton-linalg/triton/python/triton/runtime/__init__.py", line 1, in <module>
    from .autotuner import (Autotuner, Config, Heuristics, autotune, heuristics)
  File "/workspace/projs/triton-linalg/triton/python/triton/runtime/autotuner.py", line 9, in <module>
    from ..testing import do_bench, do_bench_cudagraph
  File "/workspace/projs/triton-linalg/triton/python/triton/testing.py", line 7, in <module>
    from . import language as tl
  File "/workspace/projs/triton-linalg/triton/python/triton/language/__init__.py", line 4, in <module>
    from . import math
  File "/workspace/projs/triton-linalg/triton/python/triton/language/math.py", line 1, in <module>
    from . import core
  File "/workspace/projs/triton-linalg/triton/python/triton/language/core.py", line 9, in <module>
    from ..runtime.jit import jit
  File "/workspace/projs/triton-linalg/triton/python/triton/runtime/jit.py", line 12, in <module>
    from ..runtime.driver import driver
  File "/workspace/projs/triton-linalg/triton/python/triton/runtime/driver.py", line 1, in <module>
    from ..backends import backends
  File "/workspace/projs/triton-linalg/triton/python/triton/backends/__init__.py", line 50, in <module>
    backends = _discover_backends()
  File "/workspace/projs/triton-linalg/triton/python/triton/backends/__init__.py", line 45, in _discover_backends
    backends[name] = Backend(_find_concrete_subclasses(compiler, BaseBackend),
  File "/workspace/projs/triton-linalg/triton/python/triton/backends/__init__.py", line 23, in _find_concrete_subclasses
    raise RuntimeError(f"Found 0 concrete subclasses of {base_class} in {module}: {ret}")
RuntimeError: Found 0 concrete subclasses of <class 'triton.backends.compiler.BaseBackend'> in <module 'triton_lin' from '/workspace/projs/triton-linalg/triton/python/triton/backends/triton_linalg/compiler.py'>: []

how to solve it?

hesse-x commented 2 months ago

We have not yet provided a complete Triton compilation process. The repository currently only supports converting Triton IR to Linalg IR. The path from Linalg IR to the actual backend kernel has not been provided. We will offer a compilation process based on the Cambricon backend in future updates. If you need support for other backends, please feel free to submit a PR.

In the current state of Triton-Linalg, you can test the conversion from TT IR to Linalg IR using the triton-linalg-opt as described in the README.

lordrebel commented 2 months ago

We have not yet provided a complete Triton compilation process. The repository currently only supports converting Triton IR to Linalg IR. The path from Linalg IR to the actual backend kernel has not been provided. We will offer a compilation process based on the Cambricon backend in future updates. If you need support for other backends, please feel free to submit a PR.

In the current state of Triton-Linalg, you can test the conversion from TT IR to Linalg IR using the triton-linalg-opt as described in the README.

it means that I have to work with those step:

  1. git clone triton and build with the commit id given by triton-linalg
  2. git clone triton-linalg and build in an venv
  3. run then demo and get the ttir
  4. run the triton-linlg-opt stand-alone base on readme

am I right?

hesse-x commented 2 months ago

Yes. Your understanding is correct.

We have not yet provided a complete Triton compilation process. The repository currently only supports converting Triton IR to Linalg IR. The path from Linalg IR to the actual backend kernel has not been provided. We will offer a compilation process based on the Cambricon backend in future updates. If you need support for other backends, please feel free to submit a PR. In the current state of Triton-Linalg, you can test the conversion from TT IR to Linalg IR using the triton-linalg-opt as described in the README.

it means that I have to work with those step:

  1. git clone triton and build with the commit id given by triton-linalg
  2. git clone triton-linalg and build in an venv
  3. run then demo and get the ttir
  4. run the triton-linlg-opt stand-alone base on readme

am I right?

Yes. Your understanding is correct.

lordrebel commented 2 months ago

thanks! >U<