Commit 04f87d0
authored
[FRONTEND] Fix handling of
Context: in `CodeGenerator.__init__`, globals for a given triton
function are modified to handle remapping the libdevice module to cuda
or hip (from triton-lang/triton#4539). In
particular, this logic:
```python
for k, v in gscope.items(): # gscope is a dict of fn.__globals__
...
self.gscope[k] = getattr(module_map[module_name], k)
```
was failing if you do this in the global scope: `from
triton.language.extras.libdevice import fast_dividef as
my_fast_dividef`.from m import x as y in CodeGenerator (#5081)1 parent 35f1827 commit 04f87d0
File tree
2 files changed
+24
-1
lines changed- python
- test/unit/language
- triton/compiler
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
0 commit comments