[FRONTEND] Expand MLIR bindings for out-of-tree walk#3191
Merged
jansel merged 2 commits intotriton-lang:mainfrom Mar 1, 2024
Merged
[FRONTEND] Expand MLIR bindings for out-of-tree walk#3191jansel merged 2 commits intotriton-lang:mainfrom
jansel merged 2 commits intotriton-lang:mainfrom
Conversation
Summary: This PR adds a few simple MLIR bindings to `ir.cc` to allow walking the MLIR structure of the TTIR module out of tree. This will help making the Triton kernel analysis performed in PyTorch 2 more robust and reliable. Related PR in PT2: pytorch/pytorch#120476 Test Plan: ``` $ python3 -m pytest -s python/test/unit/runtime/test_bindings.py ===================== test session starts ===================== platform linux -- Python 3.11.3, pytest-8.0.1, pluggy-1.4.0 rootdir: /data/users/aakhundov/triton/python plugins: hypothesis-6.29.3, hydra-core-1.3.2 collected 1 item python/test/unit/runtime/test_bindings.py . ===================== 1 passed in 3.02s ======================= ```
Contributor
|
@ptillet This PR is regarding the conversation we had over Slack about exposing more IR bindings for read-only introspection: https://triton-lang.slack.com/archives/C01L894JD98/p1708105403856079 @jansel just FYI |
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 24, 2024
…riton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…d MLIR walk in Triton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…riton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…d MLIR walk in Triton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…riton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…d MLIR walk in Triton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…riton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…d MLIR walk in Triton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…riton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…d MLIR walk in Triton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Feb 26, 2024
…riton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
Contributor
Author
|
@ptillet could you please take a quick look? Thank you! :) |
ptillet
approved these changes
Mar 1, 2024
Contributor
Author
Contributor
|
@aakhundov I rebased so the tests will re-run, lets see if they pass now. |
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Mar 1, 2024
…d MLIR walk in Triton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Mar 1, 2024
…riton kernel mutation analysis" Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: cc zou3519 ydwu4 [ghstack-poisoned]
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Mar 1, 2024
…l mutation analysis (#120476) Summary: Previously, we relied on the `lark`-based parsing of the string TTIR representation dumped by the Triton compiler. However, this has proven to be brittle in the face of changes both in the user-written Triton kernel code and in the Triton compiler code. In this PR, we add an alternative way of mining the function information from the TTIR based on walking the tree of structured MLIR entities. To this end, we rely on the MLIR bindings exposed by `libtriton` (related PR in Triton: triton-lang/triton#3191). For now, we introduce gating based on whether `ttir_module.hasattr("walk")`. This will allow switching to the newly introduced TTIR analysis approach only when the new MLIR bindings (including that of `ModuleOp::walk`) become available in the Triton pin. Before then, we'll keep using the old string TTIR parsing-based approach. Test Plan: The new functionality was tested locally with the latest Triton version compiled with the added new MLIR bindings: all Triton kernel mutation tests in `test_triton_kernels.py` are passing. Here we rely on the CI for regression testing, but it won't cover the new functionality due to gating. Reviewers: Subscribers: Tasks: Tags: Pull Request resolved: #120476 Approved by: https://github.com/oulgen
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Mar 12, 2024
Summary: Previously, we bailed out of the Triton kernel analysis pass when seeing a `tt.reduce` op. In this PR, we support the op and don't bail out anymore. Test Plan: This is a bit tricky, as the extension is added to the MLIR walk-based analysis code path which is active only on when the MLIR bindings added in triton-lang/triton#3191 are available. So for now I've run the `test_argmax` and `test_reduce_sum` manually with a newer Triton version than the current pin. When pin updates, we'll make those tests official (left a TODO comment). [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Mar 12, 2024
Summary: Previously, we bailed out of the Triton kernel analysis pass when seeing a `tt.reduce` op. In this PR, we support the op and don't bail out anymore. Test Plan: This is a bit tricky, as the extension is added to the MLIR walk-based analysis code path which is active only on when the MLIR bindings added in triton-lang/triton#3191 are available. So for now I've run the `test_argmax` and `test_reduce_sum` manually with a newer Triton version than the current pin. When pin updates, we'll make those tests official (left a TODO comment). ghstack-source-id: 7484e82 Pull Request resolved: #121706
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Mar 12, 2024
Summary: Previously, we bailed out of the Triton kernel analysis pass when seeing a `tt.reduce` op. In this PR, we support the op and don't bail out anymore. Test Plan: This is a bit tricky, as the extension is added to the MLIR walk-based analysis code path which is active only on when the MLIR bindings added in triton-lang/triton#3191 are available. So for now I've run the `test_argmax` and `test_reduce_sum` manually with a newer Triton version than the current pin. When pin updates, we'll make those tests official (left a TODO comment). Pull Request resolved: #121706 Approved by: https://github.com/jansel
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Mar 12, 2024
Summary: The goal is to make the `test_argmax` and `test_reduce_sum` to work both before and after triton-lang/triton#3191 is included into the Triton pin. This is important to make those tests work during the Triton pin process both in OSS and internally. Test Plan: ``` $ python test/inductor/test_triton_kernels.py -k test_reduce_sum -k test_argmax .. ---------------------------------------------------------------------- Ran 2 tests in 1.906s OK ``` [ghstack-poisoned]
aakhundov
added a commit
to pytorch/pytorch
that referenced
this pull request
Mar 12, 2024
Summary: The goal is to make the `test_argmax` and `test_reduce_sum` to work both before and after triton-lang/triton#3191 is included into the Triton pin. This is important to make those tests work during the Triton pin process both in OSS and internally. Test Plan: ``` $ python test/inductor/test_triton_kernels.py -k test_reduce_sum -k test_argmax .. ---------------------------------------------------------------------- Ran 2 tests in 1.906s OK ``` ghstack-source-id: e010a71 Pull Request resolved: #121753
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Mar 13, 2024
Summary: The goal is to make the `test_argmax` and `test_reduce_sum` to work both before and after triton-lang/triton#3191 is included into the Triton pin. This is important to make those tests work during the Triton pin update process both in OSS and internally. Test Plan: ``` $ python test/inductor/test_triton_kernels.py -k test_reduce_sum -k test_argmax .. ---------------------------------------------------------------------- Ran 2 tests in 1.906s OK ``` Pull Request resolved: #121753 Approved by: https://github.com/Skylion007
shunting314
added a commit
to shunting314/triton
that referenced
this pull request
Mar 15, 2024
This commit cherry-pick PR triton-lang#3191 . It involves quite some manual work and is not a direct cherry pick. The reason is the original PR change ir.cc which was renamed from triton.cc by another PR triton-lang#2817 . Cherry pick PR triton-lang#2817 unfortunately cause a bunch of merge conflicts: https://gist.github.com/shunting314/bb84de294fa56d3f9e2b27fbf50f5f3b . With discussion with Oguz and Jason, we decide to do a manual cherry-pcik by applying the change to triton.cc directly. We are aware the ir module is under triton._C.libtriton.triton.ir while in latest version of triton it's under triton._C.libtriton.ir .
shunting314
added a commit
to shunting314/triton
that referenced
this pull request
Mar 19, 2024
This commit cherry-pick PR triton-lang#3191 . It involves quite some manual work and is not a direct cherry pick. The reason is the original PR change ir.cc which was renamed from triton.cc by another PR triton-lang#2817 . Cherry pick PR triton-lang#2817 unfortunately cause a bunch of merge conflicts: https://gist.github.com/shunting314/bb84de294fa56d3f9e2b27fbf50f5f3b . With discussion with Oguz and Jason, we decide to do a manual cherry-pcik by applying the change to triton.cc directly. We are aware the ir module is under triton._C.libtriton.triton.ir while in latest version of triton it's under triton._C.libtriton.ir .
ptillet
added a commit
that referenced
this pull request
Mar 19, 2024
Cherry pick a few PRs to make PyTorch 2.3 work with Triton 2.2.x . Also this makes sure some python bindings needed by user defined triton kernel exists in the triton branch. --------- Co-authored-by: Philippe Tillet <[email protected]> Co-authored-by: Manman Ren <[email protected]> Co-authored-by: Manman Ren <[email protected]>
ptillet
added a commit
that referenced
this pull request
Apr 1, 2024
Cherry pick a few PRs to make PyTorch 2.3 work with Triton 2.2.x . Also this makes sure some python bindings needed by user defined triton kernel exists in the triton branch. --------- Co-authored-by: Philippe Tillet <[email protected]> Co-authored-by: Manman Ren <[email protected]> Co-authored-by: Manman Ren <[email protected]>
binarman
pushed a commit
to binarman/triton
that referenced
this pull request
Apr 2, 2024
Summary: This PR adds a few simple MLIR bindings to `ir.cc` to allow walking the MLIR structure of the TTIR module out of tree. This will help making the Triton kernel analysis performed in PyTorch 2 more robust and reliable (related PR in PT2: pytorch/pytorch#120476).
ptillet
added a commit
that referenced
this pull request
Apr 3, 2024
Cherry pick a few PRs to make PyTorch 2.3 work with Triton 2.2.x . Also this makes sure some python bindings needed by user defined triton kernel exists in the triton branch. --------- Co-authored-by: Philippe Tillet <[email protected]> Co-authored-by: Manman Ren <[email protected]> Co-authored-by: Manman Ren <[email protected]>
jjvraw
added a commit
to jjvraw/triton
that referenced
this pull request
Dec 3, 2025
Enables extracting integer attributes from MLIR operations during out-of-tree walks. Useful for extracting constant values and attributes like start/end from tt.make_range. Follows the pattern established in PR triton-lang#3191. Signed-off-by: Joshua James Venter <[email protected]>
jjvraw
added a commit
to jjvraw/triton
that referenced
this pull request
Dec 3, 2025
Enables extracting integer attributes from MLIR operations during out-of-tree walks. Useful for extracting constant values as well as attributes like start and end from tt.make_range, for example. Follows the pattern established in PR triton-lang#3191. Signed-off-by: Joshua James Venter <[email protected]>
jjvraw
added a commit
to jjvraw/triton
that referenced
this pull request
Dec 3, 2025
Enables extracting integer attributes from MLIR operations during out-of-tree walks. Useful for extracting constant values as well as attributes like start and end from tt.make_range, for example. Follows the pattern established in PR triton-lang#3191. Signed-off-by: Joshua James Venter <[email protected]>
jjvraw
added a commit
to jjvraw/triton
that referenced
this pull request
Dec 3, 2025
Enables extracting integer attributes from MLIR operations during out-of-tree walks. Useful for extracting constant values as well as attributes like start and end from tt.make_range, for example. Follows the pattern established in PR triton-lang#3191. Signed-off-by: Joshua James Venter <[email protected]>
jjvraw
added a commit
to jjvraw/triton
that referenced
this pull request
Dec 3, 2025
Enables extracting integer attributes from MLIR operations during out-of-tree walks. Useful for extracting constant values as well as attributes like start and end from tt.make_range, for example. Follows the pattern established in PR triton-lang#3191. Signed-off-by: Joshua James Venter <[email protected]>
peterbell10
pushed a commit
that referenced
this pull request
Dec 4, 2025
Enables extracting integer attributes from MLIR operations during out-of-tree walks. Useful for extracting constant values as well as attributes like start and end from `tt.make_range`, for example. Follows the pattern established in PR #3191. Signed-off-by: Joshua James Venter <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: This PR adds a few simple MLIR bindings to
ir.ccto allow walking the MLIR structure of the TTIR module out of tree. This will help making the Triton kernel analysis performed in PyTorch 2 more robust and reliable (related PR in PT2: pytorch/pytorch#120476).Test Plan: