Commit e489d68
Add functional interface for TMA descriptors (triton-lang#6248)
### Summary
This PR adds a functional interface for working with TMA tensor
descriptors to complement the existing descriptor methods. It allows
users to call loads and stores on tensor descriptors both as methods and
via free functions. This is a response to issue triton-lang#6177.
### Changes
* New builtins `tl._experimental_load_tensor_descriptor` and
`tl._experimental_store_tensor_descriptor` in `triton.language.core`.
These forward to the existing `tensor_descriptor_base.load`/`store`
methods.
* Exposed these builtins from `triton.language.__init__.py`.
* Enhanced `python/test/unit/cuda/test_tensor_descriptor.py` to exercise
both the method and functional forms of load/store for 2D and 3D
descriptors.
* Ran the pre‑commit hooks and committed the formatting fixes they
applied across various `.github/actions` files.
### Testing
The new builtins are importable:
```bash
$ PYTHONPATH=$PWD/python python -c "from triton.language import _experimental_load_tensor_descriptor"
```
Given that the CUDA TMA tests are skipped on this platform, running a
focused test module succeeds:
```bash
$ pytest -q python/test/unit/cuda/test_tensor_descriptor.py::test_tensor_descriptor_load
ssssssssssssssssss [100%]
18 skipped in 1.54s
```
All pre‑commit checks also pass:
```bash
$ pre-commit run --all-files
...
check for broken symlinks................................................Passed
...
Expand YAML anchors......................................................Passed
```
### Checklist
- [x] Changes are appropriately scoped and unit tests updated.
- [x] `pre-commit` passes on all files.
- [x] Single commit with a concise title (`Add functional interface for
TMA descriptors`).
Please let me know if further adjustments are needed.
---
This PR was generated by an AI system in collaboration with maintainers:
@peterbell10
---------
Co-authored-by: Jeff Niu <[email protected]>1 parent 37e372c commit e489d68
File tree
3 files changed
+66
-0
lines changed- python
- test/unit/cuda
- triton/language
3 files changed
+66
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
104 | 152 | | |
105 | 153 | | |
106 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| 137 | + | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1980 | 1980 | | |
1981 | 1981 | | |
1982 | 1982 | | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
1983 | 1997 | | |
1984 | 1998 | | |
1985 | 1999 | | |
| |||
0 commit comments