[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Updating Triton



I've been trying to figure out Triton's packaging for the past week or
so.  What I have done is currently at
https://salsa.debian.org/kaol/triton

I'm no Python expert so I could be mistaken about something, but I
don't see how the current version in unstable can be used.  It's
distributing no files in /usr/lib/python3/dist-packages and I reckon
that's something that all Python modules need to do in the first
place.  The current version invokes pybuild but it just fires the
CMake module which does the build but it only places some static
libraries under /usr/lib and I don't think Python would use them.

I don't know if it has worked before but trying something like
"python3 copy_strided.py" won't work.  It's one of the included
examples in Triton.

My updated version populates the dist-packages directory and trying
out the above example does a bit more, but still no cigar.  For
reference:

Traceback (most recent call last):
  File "/home/kaol/deb/triton/triton/../copy_strided.py", line 1, in <module>
    import triton
  File "/usr/lib/python3/dist-packages/triton/__init__.py", line 8, in <module>
    from .runtime import (
  File "/usr/lib/python3/dist-packages/triton/runtime/__init__.py", line 1, in <module>
    from .autotuner import (Autotuner, Config, Heuristics, OutOfResources, autotune, heuristics)
  File "/usr/lib/python3/dist-packages/triton/runtime/autotuner.py", line 7, in <module>
    from ..testing import do_bench
  File "/usr/lib/python3/dist-packages/triton/testing.py", line 7, in <module>
    from . import language as tl
  File "/usr/lib/python3/dist-packages/triton/language/__init__.py", line 4, in <module>
    from . import math
  File "/usr/lib/python3/dist-packages/triton/language/math.py", line 1, in <module>
    from . import core
  File "/usr/lib/python3/dist-packages/triton/language/core.py", line 9, in <module>
    from ..runtime.jit import jit
  File "/usr/lib/python3/dist-packages/triton/runtime/jit.py", line 11, in <module>
    from ..runtime.driver import driver
  File "/usr/lib/python3/dist-packages/triton/runtime/driver.py", line 1, in <module>
    from ..backends import backends
  File "/usr/lib/python3/dist-packages/triton/backends/__init__.py", line 50, in <module>
    backends = _discover_backends()
               ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/triton/backends/__init__.py", line 43, in _discover_backends
    compiler = _load_module(name, os.path.join(root, name, 'compiler.py'))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/triton/backends/__init__.py", line 12, in _load_module
    spec.loader.exec_module(module)
  File "/usr/lib/python3/dist-packages/triton/backends/amd/compiler.py", line 2, in <module>
    from triton._C.libtriton import ir, passes, llvm, amd
ModuleNotFoundError: No module named 'triton._C'

I'm not quite sure where to go from here.  That directory is in
upstream's setup.py's ext_modules but I don't know if everything's all
right with it.  It needed patching for our use in any case since it
would happily download dependencies unconditionally.

If the current version in unstable is indeed not usable then putting
my version there would at least allow dropping the old LLVM
dependency.  My version uses LLVM-18 which is apparently the only
version that works with recent upstream git versions.  #1061219
requests using 17 but I'm guessing going for 18 would be fine.  I
don't know how that'd fit with all the rest of ROCm stack if it's
using a different version.  I haven't been able to run and test
anything with this yet.


Reply to: