Skip to content

[triton-ext] add string arguments to addPass API#9691

Merged
CRobeck merged 2 commits into
triton-lang:mainfrom
plotfi:plotfi-pass-ext-args
Mar 18, 2026
Merged

[triton-ext] add string arguments to addPass API#9691
CRobeck merged 2 commits into
triton-lang:mainfrom
plotfi:plotfi-pass-ext-args

Conversation

@plotfi
Copy link
Copy Markdown
Contributor

@plotfi plotfi commented Mar 11, 2026

This is to support add pass cases that take arguments like this one:

passes.ttgpuir.add_f32_dot_tc(pm, emuTF32)

ie

passes.ttir.add_convert_to_ttgpuir(pm, f"cuda:{capability}", opt.num_warps, 32, opt.num_ctas)
...
passes.ttgpuir.add_f32_dot_tc(pm, emuTF32)
...
passes.ttgpuir.add_optimize_dot_operands(pm, capability >= 80)

This is handled generically by passing a list of strings, so it would work more like:

passes.plugin.add_convert_to_ttgpuir(pm, { f"cuda:{capability}", str(opt.num_warps), '32', str(opt.num_ctas) })

This wasn't added to the registerPasses API because these sort of options should be handled using an llvm cl::opt

(cherry picked from commit 03128d6)
(cherry picked from commit 835ef63)
@plotfi plotfi marked this pull request as ready for review March 11, 2026 07:07
@plotfi plotfi requested review from lezcano and ptillet as code owners March 11, 2026 07:07
@plotfi
Copy link
Copy Markdown
Contributor Author

plotfi commented Mar 11, 2026

jFYI: Pulled these unrelated changes to addPasses API out of #9626, @ThomasRaoux

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.

Looks reasonable

@CRobeck CRobeck merged commit 8ecbfb0 into triton-lang:main Mar 18, 2026
9 checks passed
raymondtay pushed a commit to raymondtay/triton that referenced this pull request Mar 22, 2026
This is to support add pass cases that take arguments like this one:


https://github.com/triton-lang/triton/blob/48079178730beab98330d15e7d672fc1abb3193f/third_party/nvidia/backend/compiler.py#L262

ie 

```python
passes.ttir.add_convert_to_ttgpuir(pm, f"cuda:{capability}", opt.num_warps, 32, opt.num_ctas)
...
passes.ttgpuir.add_f32_dot_tc(pm, emuTF32)
...
passes.ttgpuir.add_optimize_dot_operands(pm, capability >= 80)
```

This is handled generically by passing a list of strings, so it would
work more like:

```python
passes.plugin.add_convert_to_ttgpuir(pm, { f"cuda:{capability}", str(opt.num_warps), '32', str(opt.num_ctas) })
```

This wasn't added to the registerPasses API because these sort of
options should be handled using an llvm `cl::opt`
jvican pushed a commit to jvican/triton that referenced this pull request Mar 27, 2026
This is to support add pass cases that take arguments like this one:


https://github.com/triton-lang/triton/blob/48079178730beab98330d15e7d672fc1abb3193f/third_party/nvidia/backend/compiler.py#L262

ie 

```python
passes.ttir.add_convert_to_ttgpuir(pm, f"cuda:{capability}", opt.num_warps, 32, opt.num_ctas)
...
passes.ttgpuir.add_f32_dot_tc(pm, emuTF32)
...
passes.ttgpuir.add_optimize_dot_operands(pm, capability >= 80)
```

This is handled generically by passing a list of strings, so it would
work more like:

```python
passes.plugin.add_convert_to_ttgpuir(pm, { f"cuda:{capability}", str(opt.num_warps), '32', str(opt.num_ctas) })
```

This wasn't added to the registerPasses API because these sort of
options should be handled using an llvm `cl::opt`
plotfi added a commit to plotfi/triton that referenced this pull request Apr 8, 2026
This is to support add pass cases that take arguments like this one:

https://github.com/triton-lang/triton/blob/48079178730beab98330d15e7d672fc1abb3193f/third_party/nvidia/backend/compiler.py#L262

ie

```python
passes.ttir.add_convert_to_ttgpuir(pm, f"cuda:{capability}", opt.num_warps, 32, opt.num_ctas)
...
passes.ttgpuir.add_f32_dot_tc(pm, emuTF32)
...
passes.ttgpuir.add_optimize_dot_operands(pm, capability >= 80)
```

This is handled generically by passing a list of strings, so it would
work more like:

```python
passes.plugin.add_convert_to_ttgpuir(pm, { f"cuda:{capability}", str(opt.num_warps), '32', str(opt.num_ctas) })
```

This wasn't added to the registerPasses API because these sort of
options should be handled using an llvm `cl::opt`

(cherry picked from commit 8ecbfb0)
plotfi added a commit to plotfi/triton that referenced this pull request Apr 8, 2026
This is to support add pass cases that take arguments like this one:

https://github.com/triton-lang/triton/blob/48079178730beab98330d15e7d672fc1abb3193f/third_party/nvidia/backend/compiler.py#L262

ie

```python
passes.ttir.add_convert_to_ttgpuir(pm, f"cuda:{capability}", opt.num_warps, 32, opt.num_ctas)
...
passes.ttgpuir.add_f32_dot_tc(pm, emuTF32)
...
passes.ttgpuir.add_optimize_dot_operands(pm, capability >= 80)
```

This is handled generically by passing a list of strings, so it would
work more like:

```python
passes.plugin.add_convert_to_ttgpuir(pm, { f"cuda:{capability}", str(opt.num_warps), '32', str(opt.num_ctas) })
```

This wasn't added to the registerPasses API because these sort of
options should be handled using an llvm `cl::opt`

(cherry picked from commit 8ecbfb0)
(cherry picked from commit 6584c33)
@plotfi plotfi mentioned this pull request Apr 8, 2026
atalman pushed a commit that referenced this pull request Apr 10, 2026
[triton-ext] Update plugin extension changes for release 3.7.x

cherry-picking the following plugin extension changes since January:

- **[triton-ext] Fix garbage string in reported errors (#9687)**
- **[triton-ext] add string arguments to addPass API (#9691)**
- **[triton-ext][FrontEnd] Custom DSL Plugin Ops (#9626)**
- **[triton-ext] Drop LLVM_BUILD_SHARED_LIBS, enable libtriton
visibility through TRITON_EXT_ENABLED (#9783)**
- **[triton-ext] Pass a single `PluginInfo *` pointer (#9748)**
- **[triton-ext] plugin extension's version check (#9937)**

---------

Co-authored-by: Andrew Brown <andrew@kernelize.ai>
Co-authored-by: Corbin Robeck <robeck@meta.com>
plognjen pushed a commit to plognjen/triton that referenced this pull request Apr 14, 2026
This is to support add pass cases that take arguments like this one:


https://github.com/triton-lang/triton/blob/48079178730beab98330d15e7d672fc1abb3193f/third_party/nvidia/backend/compiler.py#L262

ie 

```python
passes.ttir.add_convert_to_ttgpuir(pm, f"cuda:{capability}", opt.num_warps, 32, opt.num_ctas)
...
passes.ttgpuir.add_f32_dot_tc(pm, emuTF32)
...
passes.ttgpuir.add_optimize_dot_operands(pm, capability >= 80)
```

This is handled generically by passing a list of strings, so it would
work more like:

```python
passes.plugin.add_convert_to_ttgpuir(pm, { f"cuda:{capability}", str(opt.num_warps), '32', str(opt.num_ctas) })
```

This wasn't added to the registerPasses API because these sort of
options should be handled using an llvm `cl::opt`
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.

3 participants