Repository navigation
Conversation
Performance Benchmark
Iterations: 1 warmup + 20 measured |
mark14wu
added this pull request to stack #481
September 29, 2026 20:19
mark14wu
marked this pull request as ready for review
September 29, 2026 20:20
This was referenced Sep 30, 2026
A client can now declare NEEDS_INTERPRETER = False and receive, for every traced launch, the kernels Triton compiles for each config instead of the interpreted run. The compile runs on the host for a configured GPU target, so nothing needs a GPU. Core lifecycle (tilelens/core/client.py, trace.py): - LaunchCall / LaunchEvent; the begin_launch, abort_launch, before_launch, after_launch and compile_failed hooks; each begun launch ends in exactly one of finalize or abort_launch. begin_launch now creates the per-launch Launch; a concurrent launch of one trace from another thread is refused, and so is a second traced launch capturing the same JITFunction. - Client declarations NEEDS_INTERPRETER, IR_STAGES, LAUNCH and ir_target. Interpreter hooks reach interpreting clients only. - ClientManager.ir_capture routes every JITFunction.run call of the traced kernel through a host compile and delivers one event per (specialization, binding fingerprint) per launch; a failing compile is compile_failed data and never fails the launch; a call that does not bind raises as untraced. - TritonTrace compiles every (pruned) config through a separate IR runner chain. An IR-only launch never launches the real kernel; a mixed trace compiles for the IR clients, then interprets for the eager ones. - Each runner chain's Autotuner copies drop the call's arguments (nargs) and restore_value clones (restore_copies) when the call returns or raises, so no caller tensor outlives a launch that raised. Host compile (tilelens/core/host_compile.py): binds and packs a call with the JIT's own binder and compiles it through the backend's TTIR passes for the target, with the front end's target queries answered by that target and every device query refused. IR targets are "cuda:89" by default (TILELENS_IR_TARGET, Client.ir_target); IR mode runs on Triton 3.8 only, checked in one place (config.ir_triton_unsupported). tilelens.ir: IRClient (a finalize template over a per-launch ArtifactLog), LaunchBinding/TensorFacts, a content-addressed ParseCache and the IRVerdict records, which saved traces round-trip. ParseCache's default reader is the TTIR reader, which this change does not add: until it exists, a lookup with the default reader is an error outcome. The tests use stub readers. Not supported yet, refused instead of half-done: - running the real kernel after the host compile: an IR client must declare LAUNCH = "skip"; - stages other than "ttir": IR_STAGES naming another stage is refused when the client is added; - several IR targets in one trace: refused when the launch compiles; - whole-pipeline compiles: TRITON_KERNEL_OVERRIDE, USE_IR_LOC, an ir_override option and a custom pipeline make the host compile raise HostCompileUnavailable. CI installs triton==3.8.0 and triton_kernels at v3.8.0, with UV_NO_SYNC so `uv run` keeps that pin.
mark14wu
removed this pull request from stack #481
October 4, 2026 23:48
mark14wu
added this pull request to stack #496
October 4, 2026 23:48
This was referenced Oct 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets a TileLens client analyze the kernels Triton compiles for a launch instead of interpreting it, without a GPU: a client declares
NEEDS_INTERPRETER = Falseand receives, for every traced launch, the TTIR compiled on the host for each config. IR mode supports Triton 3.8 only.Part of the stack #494 → #479 → #495 → #480 → #482. It sits on #494 (trace fixes). The TTIR reader comes in #495 and the first real client, the compiled sanitizer, in #480.
What's included
tilelens/core/client.py,trace.py)LaunchCall/LaunchEventand thebegin_launch,abort_launch,before_launch,after_launchandcompile_failedhooks; each begun launch ends in exactly one offinalizeorabort_launch. A concurrent launch of one trace from another thread is refused.NEEDS_INTERPRETER,IR_STAGES,LAUNCHandir_target; interpreter hooks reach interpreting clients only.ClientManager.ir_captureroutes everyJITFunction.runcall of the traced kernel through a host compile and delivers one event per (specialization, binding) per launch. A failing compile iscompile_faileddata and never fails the launch; a call that does not bind raises as it does untraced.tilelens/core/host_compile.py): binds and packs a call with the JIT's own binder and compiles it through the backend's TTIR passes for the target (cuda:89by default,TILELENS_IR_TARGET,Client.ir_target), with target queries answered by that target and every device query refused. On a Triton other than 3.8 every IR launch is reported unsupported and the program continues.tilelens.ir:IRClient(a finalize template over a per-launch artifact log),LaunchBinding/TensorFacts, a content-addressedParseCacheand theIRVerdictrecords, whichtilelens.save()round-trips.triton==3.8.0andtriton_kernelsatv3.8.0, withUV_NO_SYNC=1souv runkeeps that pin.Not supported yet (refused instead of half-done)
LAUNCH = "skip"."ttir"inIR_STAGES.TRITON_KERNEL_OVERRIDE,USE_IR_LOC,ir_override, custom pipelines).Testing
Triton 3.8, CPU only: 373 passed at this branch's tip (this layer's lifecycle, host-compile, capture and client tests plus #494's), with no new failure in the eager test files.
The earlier, larger version of this PR (conformance suite, golden corpus, multi-release support) is preserved on branch
ir-mode-tests-archive.