Commit 08d7f64
authored
[INTERPRETER] Improve support for aliased tensors in interpreter (#5890)
If two tensors alias, the interpreter will clobber writes when it makes
a CPU copy of its backing storage. Identifying this in general is quite
difficult, but in most cases aliasing tensors share the same backing
storage. If we set up our CPU-side storage to mirror the device, then we
can avoid this particular bug in that case. This partially fixes #5791.
<!---
The core Triton is a small number of people, and we receive many PRs
(thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the
following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them.
-->
# New contributor declaration
- [X] I am not making a trivial change, such as fixing a typo in a
comment.
- [ ] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [X] I have run `pre-commit run --from-ref origin/main --to-ref HEAD`.
- Select one of the following.
- [X] I have added tests.
- `/test` for `lit` tests
- `/unittest` for C++ tests
- `/python/test` for end-to-end tests
- [ ] This PR does not need a test because `FILL THIS IN`.
- Select one of the following.
- [X] I have not added any `lit` tests.
- [ ] The `lit` tests I have added follow these [best
practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python
code
and using the instructions it generates is not minimal.)1 parent b2a86b1 commit 08d7f64
File tree
2 files changed
+26
-9
lines changed- python
- test/unit/language
- triton/runtime
2 files changed
+26
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7025 | 7025 | | |
7026 | 7026 | | |
7027 | 7027 | | |
| 7028 | + | |
| 7029 | + | |
| 7030 | + | |
| 7031 | + | |
| 7032 | + | |
| 7033 | + | |
| 7034 | + | |
| 7035 | + | |
| 7036 | + | |
| 7037 | + | |
| 7038 | + | |
| 7039 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
| 1160 | + | |
1160 | 1161 | | |
1161 | 1162 | | |
1162 | 1163 | | |
1163 | 1164 | | |
1164 | 1165 | | |
1165 | 1166 | | |
| 1167 | + | |
1166 | 1168 | | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
1167 | 1174 | | |
1168 | | - | |
1169 | | - | |
| 1175 | + | |
1170 | 1176 | | |
1171 | 1177 | | |
1172 | 1178 | | |
| |||
1175 | 1181 | | |
1176 | 1182 | | |
1177 | 1183 | | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
| 1184 | + | |
1184 | 1185 | | |
1185 | 1186 | | |
1186 | 1187 | | |
| 1188 | + | |
1187 | 1189 | | |
1188 | 1190 | | |
1189 | 1191 | | |
1190 | 1192 | | |
1191 | 1193 | | |
1192 | | - | |
| 1194 | + | |
1193 | 1195 | | |
1194 | 1196 | | |
1195 | 1197 | | |
| |||
1202 | 1204 | | |
1203 | 1205 | | |
1204 | 1206 | | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1205 | 1210 | | |
1206 | 1211 | | |
1207 | 1212 | | |
| |||
0 commit comments