Skip to content

[pull] main from SandAI-org:main - #30

Merged
pull[bot] merged 1 commit into
cennn:mainfrom
SandAI-org:main
Sep 29, 2026
Merged

pull[bot] merged 1 commit into
cennn:mainfrom
SandAI-org:main

Conversation

@pull

@pull pull Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

)

Root cause: autotune_at_compile_time=False defers Triton kernel autotuning
to first forward pass. Results go to Triton's in-memory cache only —
Triton's disk cache for autotune results (check_disk_cache /
.autotune.json) is disabled by default (knobs.autotuning.cache=False).
Each new pod re-benchmarks all kernel configs: ~3-5 min overhead.

Fix: Set TRITON_CACHE_AUTOTUNING=1 in _compilation_context(). This enables
Triton's built-in autotune disk cache (Autotuner.check_disk_cache), which
writes .autotune.json files to TRITON_CACHE_DIR. Since MagiCompiler already
points TRITON_CACHE_DIR to persistent AFS, bake warmup autotune results are
automatically reused by verify pods.

Flow:
  Bake: compile → warmup forward → autotune → .autotune.json saved to AFS
  Verify: load .so → first forward → read .autotune.json → skip benchmark

Verified with isolated 2-process experiment: 2.6x speedup on cache hit
(1.97s → 0.76s for a simple kernel; real 400B model speedup expected to
be much larger due to many more kernels).

Also updated piecewise_compiler.py comment to document the full mechanism.

Co-authored-by: cenn <cenn@cenndeMacBook-Pro.local>
@pull pull Bot locked and limited conversation to collaborators Sep 29, 2026
@pull pull Bot added the ⤵️ pull label Sep 29, 2026
@pull
pull Bot merged commit 7ee2183 into cennn:main Sep 29, 2026
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant