Repository navigation
Commit 7997fd3
authored
[executorch][cuda] Find the tuned INT4 kernel's def under its module-level name too
Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.15.0) (oldest at bottom):
* __->__ #24096
`test_a_tuned_shape_traces_only_its_picked_config` finds the user kernel in Inductor's wrapper by the exact text `def _int4_w4a16_direct_kernel(`. That only matches the wrapper's `async_compile.triton('''...''')` string form, which keeps the kernel's own name.
pytorch/pytorch#200502 makes Inductor's python wrapper define each Triton kernel as module-level code by default. There, the def takes Inductor's kernel name, `_int4_w4a16_direct_kernel_0`. The test failed on its DiffTrain import, D126740082, which was reverted partly for this.
The test now matches `^def <name>\w*\(` and slices back to the `user_autotune(` before that match. The decorator's `configs=[...]` still comes right before the def in both forms, so the check that only the picked config is traced is unchanged. This lands ahead of the #200502 reland.
___
@landed-with-radar-review
Differential Revision: D126992211
Pull Request resolved: #240961 parent bafd4c0 commit 7997fd3
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
887 | 888 | | |
888 | 889 | | |
889 | 890 | | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
894 | 895 | | |
895 | 896 | | |
896 | 897 | | |
| |||
0 commit comments