Skip to content

Move python/src/ir.h to triton/Tools/OpBuilder.h#9826

Closed
abrown wants to merge 1 commit into
triton-lang:mainfrom
abrown:fix-exported-header
Closed

Move python/src/ir.h to triton/Tools/OpBuilder.h#9826
abrown wants to merge 1 commit into
triton-lang:mainfrom
abrown:fix-exported-header

Conversation

@abrown
Copy link
Copy Markdown
Contributor

@abrown abrown commented Mar 24, 2026

Using python/src/ir.h in PluginUtils.h causes build failures for plugins (e.g., this triton-ext failure) because those headers are not included in the C++ artifact package plugins build against (introduced in #9534). And they should not be: the C++ source in the python directory is used for building the Python-interfacing library. This change fixes all of that by moving the header-defined TritonOpBuilder class to the include directory.

Using `python/src/ir.h` in `PluginUtils.h` causes build failures for
plugins (e.g., this triton-ext [failure]) because those headers are
not included in the C++ artifact package plugins build against
(introduced in triton-lang#9534). And they should not be: the C++ source in the
`python` directory is used for building the Python-interfacing library.
This change fixes all of that by moving the header-defined
`TritonOpBuilder` class to the `include` directory.

[failure]: https://github.com/triton-lang/triton-ext/actions/runs/23460115506/job/68259370483#step:12:86
Copy link
Copy Markdown
Collaborator

@ThomasRaoux ThomasRaoux left a comment

Choose a reason for hiding this comment

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

I think this is worse in term of code organization.

@abrown
Copy link
Copy Markdown
Contributor Author

abrown commented Mar 24, 2026

Is there a better place?

@abrown
Copy link
Copy Markdown
Contributor Author

abrown commented Mar 25, 2026

Superseded by #9847.

@abrown abrown closed this Mar 25, 2026
peterbell10 pushed a commit that referenced this pull request Apr 24, 2026
#9626 added a way to construct custom ops by depending on
`python/src/ir.h`, a header not present in the installation artifacts
(#9534) used for building plugins in
[triton-ext](https://github.com/triton-lang/triton-ext). If we don't
want to move this header to a directory already packaged up by CMake
(#9826), we could additionally package up the headers in the `python`
directory instead: this change does exactly that.

In doing so, it also exposed another problem in how we package up these
installation artifacts. We currently only package up files ending in
`*.h`, so `Dump.hpp` and `GetEnv.hpp` were not included. To fix this,
this change renames these files to `Dump.h` and `GetEnv.h` which seems
more in line with the rest of the project.
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 this pull request may close these issues.

2 participants