Commit a7bfc85
[FIX] Inline ceil_log2 in gpu_2d_continuous_cumsum to fix MakePackedAPI error (#18957)
- The intermediate variable `ceil_log2` in `gpu_2d_continuous_cumsum`
created a `LetStmt`-bound `Var` in the TIR function
- When `MakePackedAPI` processed the function, it reported `ceil_log2`
as an undefined variable not passed as an API argument
- Inline the expression directly into `total_rounds` to avoid the
intermediate `Var` — the computation is identical
## Test plan
- Compile a model that uses GPU sampling (e.g. any LLM with top-p
sampling on Metal) and verify compilation succeeds
- The error this fixes: `Check failed: undefined.size() == 0: In
PrimFunc gpu_2d_continuous_cumsum variables [ceil_log2] are used, but
are not passed in as API arguments`
Co-authored-by: Akaash Parthasarathy <43900735+akaashrp@users.noreply.github.com>1 parent ec0daad commit a7bfc85
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
| 162 | + | |
164 | 163 | | |
165 | 164 | | |
166 | 165 | | |
| |||
0 commit comments