Skip to content

Probe the optional launch ABI before constructing the JIT function (#65 on current main) - #74

Merged
liuanji merged 1 commit into
mainfrom
probe-launch-abi-first
Nov 4, 2026
Merged

liuanji merged 1 commit into
mainfrom
probe-launch-abi-first

Conversation

@liuanji

@liuanji liuanji commented Nov 4, 2026

Copy link
Copy Markdown
Member

Supersedes #65 by hxu129: the same source change, on current main, under hxu129's authorship. The tests from #65 are left out on purpose.

FastJITFunction3x constructed the JIT function before importing the optional triton.knobs. Where a Triton 3.x lacks it, that import fails and triton_jit constructs the stock fallback, parsing each kernel's source twice. The imports now come first, so the fallback constructs one JIT function.

MEASURED on import pyjuice, Triton 3.7, about 2.7 s in every arm:

triton.jit calls Time in them
knobs available, before and after 170 48 ms
knobs blocked, before 248 79 ms
knobs blocked, after 170 48 ms

With knobs available the fast wrapper is still chosen. Blocking the import stands in for a release without it; this was not run on a real Triton 3.0.0 here, though #65 reports doing so.

tests/misc/kernel_launcher_test.py passes with the change. Not run: the full suite, which will run once the pending PRs are merged.

`FastJITFunction3x` constructed the JIT function before importing the optional `triton.knobs`. Where a Triton 3.x lacks it, that import fails and `triton_jit` constructs the stock fallback, parsing each kernel's source twice. The imports now come first, so the fallback constructs one JIT function.

From #65, on current main, without its tests. MEASURED, `import pyjuice` on Triton 3.7, the optional import blocked to stand in for a release without it: 248 `triton.jit` calls, 79 ms -> 170, 48 ms, of about 2.7 s. With it available nothing changes: 170 calls, 48 ms, the same fast wrapper. `tests/misc/kernel_launcher_test.py` passes; the full suite runs once the pending PRs are merged.
@liuanji
liuanji merged commit 87b947a into main Nov 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants