Skip to content

Conversation

@jamesthejellyfish
Copy link
Collaborator

added the ability to call triton functions from within a PyDSL function. This works by parsing the triton ir (ttir), and then using an open-source tool called triton-adapter-opt from triton-ascend to convert the ttir to linalg mlir, which then gets combined into the PyDSL mlir file. Note that when calling a triton function, in addition to the triton args, you must include three extra UInt32 parameters which define the grid index (x,y,z)

Copy link
Collaborator

@Balint-R Balint-R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments. I have not really looked at test_triton.py or examples/triton_interop.py yet. I will review this again after most of my comments are resolved.

My biggest question right now is probably, what is the code that parses how many arguments the Triton function has based on the MLIR and why do we need it? Also in general, how does the process of actually calling the Triton function work?

@Balint-R
Copy link
Collaborator

We should also figure out how to set up Triton in CI.

@jamesthejellyfish
Copy link
Collaborator Author

We should also figure out how to set up Triton in CI.

Yes I have been talking with @xushengj about this. It will probably be something I do at the same time when I am working on the feature to separate the formatting and the test on CI.

@jamesthejellyfish jamesthejellyfish force-pushed the feature-triton-interop branch 5 times, most recently from 3d10202 to bb1009e Compare July 31, 2025 19:13
@Balint-R
Copy link
Collaborator

Comments I marked as resolved but we should revisit later:

@Balint-R
Copy link
Collaborator

Maybe address my existing comments and #63, and then we can merge. I am tired of reading over this so many times. There are probably not major issues anymore.

Copy link
Collaborator

@Balint-R Balint-R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesthejellyfish you should fix the one thing I commented today, rebase onto main (you will have to resolve a trivial merge conflict), then you can merge!

@jamesthejellyfish jamesthejellyfish merged commit 3684309 into Huawei-CPLLab:main Aug 15, 2025
2 checks passed
@Balint-R Balint-R added the feature New feature or request label Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants