Add host_build_graph copies of the paged_attention and qwen3_14b_decode examples - #1665
Add host_build_graph copies of the paged_attention and qwen3_14b_decode examples#1665noabauma wants to merge 1 commit into
Conversation
|
Important Review skippedToo many files! This PR contains 112 files, which is 12 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (112)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
examples/a2a3/host_build_graph/did not exist; these three examples weretensormap_and_ringbuffer-only.paged_attention/paged_attention_manual_scope/qwen3_14b_decode/Why this is nearly free
orchestration/pto_orchestration_api.his byte-identical between the tworuntimes, and
KernelCompiler.compile_orchestration(runtime, source)picks theinclude dirs of whichever runtime
@scene_testnames. So the kernels and theorchestration C++ are unchanged copies — including qwen3's vendored
paged_attention_ccetree and its 1,980-line generated orchestration. ThePython delta is the
runtime=decorator, the class name, and ring sizing.The one real difference: ring sizing
host_build_graphbuilds the whole graph before the device schedules anything,so nothing is reclaimed mid-orchestration (heap
tail=0throughout) and theentire graph must be resident. Each case carries its own
runtime_envinCASES[*]["config"], so noPTO2_RING_*is needed.Which knob binds depends on the graph's shape:
(
tasks = batch * (4 * ceil(context_len/block_size) + 1)), soring_task_window131072 / heap 2 GiB; Case2 65536 / 1 GiB.window, but 40 layers of simultaneously-live intermediates overrun the
256 MiB default heap. Measured: 256 MiB →
Task Allocator Deadlock - Heap Exhausted(~254 of 256 MiB used,tail=0); 512 MiB passes.On
tensormap_and_ringbuffernone of this is needed, because scope-localintermediates are freed as orchestration proceeds.
Validation (a2a3, golden checking on)
device_wall38.1 ms vs 36.8 ms for the upstream TMR example.Omissions
Case3(head_dim: 256) is not included — it fails on both runtimes:the unmodified upstream TMR example gives
max_diff=0.1255, hbg givesmax_diff=nan. The graph executes normally (16 ms device_wall, no deadlock),so this is a pre-existing kernel numerics/tiling defect at
head_dim > 128,not a port artifact. The existing
tests/st/.../host_build_graph/paged_attentionalso omits it, without recording why.
host_build_graphhas no SPMD coverage in the tree.