Skip to content

Make symbol-scoped Triton launch configurations tunable - #133

Merged
irvineoy merged 4 commits into
mainfrom
codex/tunable-triton-launch-config
Oct 27, 2026
Merged

irvineoy merged 4 commits into
mainfrom
codex/tunable-triton-launch-config

Conversation

@irvineoy

@irvineoy irvineoy commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Protecting Triton host wrappers also froze their launch-tuning parameters. This change restores those settings through an editable _launch_config helper while keeping the wrapper, grid derivation, input layouts and numerical checks protected.

The scope is one pilot task, triton2triton/vllm/triton_bmm, plus the shared framework support. The other 18 task conversions are follow-up work.

  • Add configuration_symbols to symbol-scoped edit declarations and describe it in agent prompts and validator context.
  • Restrict declared helpers to plain metadata parameters, local configuration data, literal collections, arithmetic, branches and explicitly allowed pure metadata calls. Validate defaults and annotations as well as bodies; reject global/helper access, implicit helper dispatch, callbacks and shadowed call targets. Keep declared launch helpers out of definition-time decorator factories, whose arguments are editable.
  • Preserve the existing definition-time configuration-factory policy and the runtime-patching protections on main.
  • Keep BMM's initial launch settings unchanged for float16, bfloat16 and float32. The protected wrapper validates exactly five integer settings and derives the full launch grid from the selected tiles.
  • Reject malformed configuration-symbol lists with a task configuration error.

Validation:

  • Local macOS / Python 3.12: 3,023 passed, 1 skipped across the related guard, configuration-policy, BMM, prompt, boundary and migration suites. The 30 focused configuration-policy cases cover helper subscripts, defaults and annotations, callbacks, shadowing and valid shape-based tuning, including early-return branches.
  • make check-perf-helpers and Python 3.12 source compilation pass.
  • Full Linux CPU/mock CI: 18,798 passed, 154 skipped; performance-helper audit and source compilation passed on commit 0cd82d6e6241ef1a5ea34da5ebe29c3baf59c1d8.
  • GPU task_validator was not run. The maintainer explicitly waived GPU testing for this merge; this change makes no new GPU correctness or performance claim.

A symbol-scoped task can now list editable symbols in configuration_symbols.
Protected code may call them at launch time, so the harness guard requires
each to stay an undecorated function that passes the existing
configuration-factory body check. Without the declaration the guard does not
restrict an editable plain function's body, so a launch-time helper could run
arbitrary host code.

The field must be a subset of symbols and cannot name an entrypoint.
Undeclared editable functions keep the existing policy. The validator
context and the agent prompt report the declared symbols.
Move the wrapper's per-dtype tile sizes, num_warps and num_stages into the
editable _launch_config configuration symbol. The protected wrapper accepts
exactly those integer keys within bounds and still derives the grid from
the validated tiles. The initial values are unchanged, so baseline
launches and timing stay the same.

Record exact inverses of the source and config edits so the older
migration tests keep comparing the previously reviewed bytes, and extend
the boundary and domain-control tests to the new editable helper.
Restrict declared configuration symbols to caller metadata, local data,
literal defaults and simple annotations. Reject global object access and
implicit helper execution while preserving shape-based tuning and the
existing definition-time factory policy.

Add regression coverage for helper subscripts, signatures, callbacks,
shadowed metadata calls and malformed configuration symbol declarations.
Integrate current main without changing the BMM baseline launch settings.
@irvineoy
irvineoy changed the base branch from codex/drop-readme-contract-pins to main October 27, 2026 16:53
@irvineoy
irvineoy marked this pull request as ready for review October 27, 2026 16:53
Only protected launch callers may supply metadata to declared configuration
helpers. Prevent editable compiler decorators from invoking those helpers
with arbitrary host objects, and cover the BMM definition-time regression.
@irvineoy
irvineoy merged commit ac45f12 into main Oct 27, 2026
2 checks 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.

1 participant