Commit 7131411
authored
[Bugfix][TIR][VTA] Update host-side target, even without device func (#14982)
This resolves an issue introduced by the combination of
#14918 and
#14945. The bug occurred for
targets that do not require device-side codegen, but do require a
`device_type` other than `kDLCPU`. It wasn't caught by CI, as the
issue only occurred with the combination of both PRs.
1. #14918 updated `SplitHostDevice` to only modify the `"target"`
attribute when a device-side function has been extracted.
2. For VTA, there is no device-side function, as everything is done
through host-side API calls.
3. From (1) and (2), the VTA examples kept the target
`T.target("ext_dev", host="llvm")` after the `SplitHostDevice`
pass, instead of being updated to `T.target("llvm")`.
4. #14945 restricted CombineContextCall to only apply to host-side
passes.
5. From (4) and (5), the `CombineContextCall` pass was no longer
applied to the VTA context calls.
This PR fixes `SplitHostDevice`, updating the target from
`T.target("ext_dev", host="llvm")` to `T.target("llvm")`, even if no
device sections have been extracted from the function.1 parent 4267fbf commit 7131411
File tree
2 files changed
+21
-5
lines changed- src/tir/transforms
- tests/python/unittest
2 files changed
+21
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 111 | + | |
114 | 112 | | |
115 | | - | |
116 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
171 | 187 | | |
172 | 188 | | |
0 commit comments