hbg: record Graph off the ring on A5 so the first invocation is one GRAPH task - #1780
Conversation
|
Warning Review limit reached
Next review available in: 22 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
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 |
5ab676d to
a635be9
Compare
…RAPH task Ports a2a3 host_build_graph PR hw-native-sys#1731 to A5. Mirrors hw-native-sys#1731 line-for-line. With hw-native-sys#1777 in place, the scalar-source machinery hw-native-sys#1731's recording path depends on now exists on A5, so the port is direct: - PTO2TaskAllocator gains reserve_heap_scratch / restore_heap_top. - The recording pass routes submit_task / submit_dummy_task / alloc_tensors to graph_record_submit_node, which records each node's layout off the ring — output buffers come from heap scratch (released in graph_end) instead of a task-window slot. No ring slot, tensormap, fanin-pool entry, or upload is produced for an internal node. - A scope inside a Graph body is a no-op during recording. - graph_end rolls the heap back to the recording watermark, compacts and caches the Definition, and emits the single outer GRAPH task. It now returns bool; when the outer task cannot be placed, the body re-runs on the ordinary path so its work is still submitted. - The graph_end ops-table entry changes void -> bool in both mirrored ops structs. The first invocation now occupies one ring slot and one heap block instead of one per internal node. Verified: full no-hardware C++ unit suite (92/92) and the A5 graph_execution a5sim scenes (3/3).
Ports a2a3
host_build_graphPR #1731 (record Graph off the ring) to A5. Builds on #1777 (the #1732 port, now merged), since #1731's recording path consumes the scalar-source machinery #1732 introduces.Why
A5 Graph Execution was ported in #1733 from a pre-#1731 a2a3 snapshot, and the parity follow-ups #1736/#1737 were never opened. On a cache miss the recording pass ran the Graph body through the ordinary submit path: every internal task took a ring task-window slot and a ring-heap allocation while being recorded. This brings A5 to parity with a2a3's current recording path.
What (mirrors #1731)
PTO2TaskAllocatorgainsreserve_heap_scratch/restore_heap_top.submit_task/submit_dummy_task/alloc_tensorsto a newgraph_record_submit_node, which records each node's layout off the ring — output buffers come from heap scratch (released ingraph_end) instead of a task-window slot. No ring slot, tensormap, fanin-pool entry, or upload is produced for an internal node.graph_endrolls the heap back to the recording watermark, compacts and caches the Definition, and emits the single outer GRAPH task. It now returnsbool; when recording is unsupported or the outer task cannot be placed, the body re-runs on the ordinary path so its work is still submitted. Thegraph_endops-table entry changesvoid→boolin both mirrored ops structs.The first invocation now occupies one ring slot and one heap block instead of one per internal node.
Testing
pto_ring_buffer.handpto_orchestration_api.hnow byte-identical to a2a3;pto_orchestrator.cppdown to 30 arch-only diff lines (was 387)Refs #1731.