Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version compatible with Triton 2.3.0? #27

Open
kenneth-ge opened this issue May 30, 2024 · 12 comments · Fixed by #29
Open

Version compatible with Triton 2.3.0? #27

kenneth-ge opened this issue May 30, 2024 · 12 comments · Fixed by #29

Comments

@kenneth-ge
Copy link

Currently running Triton 2.3.0 on Fedora 40 and Python 3.12.3. Unfortunately, version 2.3.0 is the newest one available to me at the moment, due to having an AMD video card. As a result, I'm running into a lot of issues, due to major refactoring in the interpreter module.

Is there a version of triton_viz that is compatible with Triton 2.3.0? If not, do you have any advice on how to adapt this library to be compatible?

@Jokeren
Copy link
Member

Jokeren commented May 30, 2024

Nope. I plan to release a version compatible with the upcoming triton 3.0 release. From there we will pinpoint stable triton versions in the future. My student @tejas3070 is on vacation now, so it is supposed to be done when he is back.

@Jokeren
Copy link
Member

Jokeren commented May 30, 2024

Is there any reason why you cannot install triton/main from source?

@kenneth-ge
Copy link
Author

Afaik the latest version supported by AMD ROCm is 2.3.0 (forked from some earlier version 2.X but supposedly feature-parallel). I've been trying to see if there is a newer triton build, but if there is it seems that it must be a ways away from release

@Jokeren
Copy link
Member

Jokeren commented Jun 15, 2024

I'm working on the amd backend and always build from source. Let me know if you have questions.

@parsifal-47
Copy link

doesn't work with the latest triton for me, I see:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[9], line 9
      6     x = tl.load(x_ptr + range, range < 5, 0)
      7     print(x)
----> 9 triton_viz.trace(demo)[(1, 1, 1)](torch.ones(4, 3))
     10 triton_viz.launch()

File ~/projects/triton/python/triton/runtime/jit.py:326, in KernelInterface.__getitem__.<locals>.<lambda>(*args, **kwargs)
    320 def __getitem__(self, grid) -> T:
    321     """
    322     A JIT function is launched with: fn[grid](*args, **kwargs).
    323     Hence JITFunction.__getitem__ returns a callable proxy that
    324     memorizes the grid.
    325     """
--> 326     return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs)

File ~/myenv/lib/python3.12/site-packages/triton_viz/trace.py:16, in Trace.run(self, *args, **kwargs)
     14 def run(self, *args, **kwargs):
     15     with patch():
---> 16         return self._fn.run(*args, **kwargs)

File ~/projects/triton/python/triton/runtime/interpreter.py:1140, in InterpretedFunction.__init__.<locals>.run(*args, **kwargs)
   1138 grid = kwargs["grid"]
   1139 fn = self._rewrite_ast()
-> 1140 return GridExecutor(fn, self.arg_names, grid)(*args, **kwargs)

File ~/myenv/lib/python3.12/site-packages/triton_viz/interpreter.py:137, in _grid_executor_call(self, *args_dev, **kwargs)
    136 def _grid_executor_call(self, *args_dev, **kwargs):
--> 137     args_hst = self._init_args_hst(args_dev)
    138     # Removes reserved keywords from kwargs
    139     kwargs = {k: v for k, v in kwargs.items() if k not in RESERVED_KWS}

TypeError: GridExecutor._init_args_hst() missing 1 required positional argument: 'kwargs'

it would be helpful if you mention exact versions of triton that are supported

@Jokeren
Copy link
Member

Jokeren commented Jul 4, 2024

I updated triton recently but haven't updated triton-viz yet.

You can use any commit before triton-lang/triton@1b35f11

I believe it will be a simple fix. Happy to merge if you could contribute a PR.

@parsifal-47
Copy link

sounds good, let me take a look

@dengl11
Copy link

dengl11 commented Jul 5, 2024

I hit the same error

TypeError: GridExecutor._init_args_hst() missing 1 required positional argument: 'kwargs'

before; but after git pull the triton-viz repo today and pip install -e . there; the error is gone for me

@parsifal-47
Copy link

After looking, I am confused, I was using a tag v1 initially, this error is easy to fix, but when I fix it, I see more errors.

On the other hand, it is already fixed on main and keren/v2.0, but when I try them, they fail differently. Is there any a known combination of versions that works?

@dutsc
Copy link

dutsc commented Jul 9, 2024

@dengl11 Did you git pull the main branch? I followed your instructions and still got the same error.

TypeError: GridExecutor._init_args_hst() missing 1 required positional argument: 'kwargs'

Could you please tell me your torch and triton versions?

@dutsc
Copy link

dutsc commented Jul 9, 2024

@parsifal-47 Yes, when I try keren/v2.0 and execute python examples/dot.py, I get the follow error:

AttributeError: module 'triton_viz' has no attribute 'collect_grid'

@Jokeren
Copy link
Member

Jokeren commented Jul 9, 2024

v2.0 is not a stable branch...Maybe I shouldn't commit it to github...

@Jokeren Jokeren linked a pull request Jul 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants