Commit 7025305
authored
[AMD][GLUON] Wait outstanding async commit groups instead of instructions (#8605)
Currently `async_wait` in Gluon on `CDNA4` requires the kernel writer to
pass the number of outstanding hardware instructions/llvm intrinsic to
`async_wait`. This count is very difficult to compute as it relies on
layouts, sizes, contiguity...
This PR changes the semantics of `async_wait` to represent the number of
outstanding commit groups. This follows the semantics used for nvidia in
Gluon. Therefore, Gluon kernels need to commit outstanding async
operations via `commit_group` and then wait on them via `wait_group`. I
also adapted the names so existing Gluon kernels using the old semantics
error out.
`UpdateAsyncWaitCount` is extended to compute the number of outstanding
hardware instructions based on the number of oustanding commits groups.
Previously, it only worked on `async_waits` carrying tokens of the
commit groups which are not available when compiling a Gluon kernel.
This is done by walking the IR backwards following *all* possible
control flow paths and finding the smallest number of emitted
instructions for N outstanding commit groups.1 parent 4c2175f commit 7025305
File tree
6 files changed
+836
-96
lines changed- python
- test/gluon
- triton/experimental/gluon/language/amd/cdna4
- test/TritonGPU/amd
- third_party/amd/lib/TritonAMDGPUTransforms
6 files changed
+836
-96
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
| 544 | + | |
544 | 545 | | |
545 | | - | |
| 546 | + | |
546 | 547 | | |
547 | 548 | | |
548 | 549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1950 | 1950 | | |
1951 | 1951 | | |
1952 | 1952 | | |
1953 | | - | |
1954 | | - | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
1955 | 1974 | | |
1956 | 1975 | | |
1957 | 1976 | | |
1958 | 1977 | | |
1959 | | - | |
| 1978 | + | |
1960 | 1979 | | |
1961 | 1980 | | |
1962 | 1981 | | |
1963 | | - | |
| 1982 | + | |
1964 | 1983 | | |
1965 | 1984 | | |
1966 | 1985 | | |
| |||
Lines changed: 25 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
| |||
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
121 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
122 | 139 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
128 | 143 | | |
129 | 144 | | |
130 | | - | |
| 145 | + | |
131 | 146 | | |
132 | 147 | | |
133 | 148 | | |
| |||
0 commit comments