Skip to content

Add: declare HBG kernel resource requirements and stream contracts - #2

Closed
TaoZQY wants to merge 1 commit into
codex/hbg-pr-h1from
codex/hbg-pr-2b
Closed

TaoZQY wants to merge 1 commit into
codex/hbg-pr-h1from
codex/hbg-pr-2b

Conversation

@TaoZQY

@TaoZQY TaoZQY commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Kernel resource preparation needs sizes derived from the built graph. Add read-only queries for heap, runtime image, Definition and scheduler requirements, then aggregate compatible graphs by region and recompute aligned offsets for a serialized execution slot.

Align common contract validation with the TMR resource vocabulary while preserving the 64-byte K1 invocation ABI and program-mode byte semantics. Require three distinct streams: borrowed caller, dedicated non-hidden AICPU and hidden AICore. Reject configuration-only HBG sizing because it lacks the built graph.

Validation

  • Runtime libraries rebuilt; all 142 non-hardware C++ test executables passed, including 24 HBG cases per architecture and contract/loader admission tests.
  • ABI tests: 16 passed, 4 hardware-marked skipped.
  • Full simulation sweeps: A2/A3 73 passed, 8 skipped; A5 70 passed.
  • Tests cover overflow, Definition framing, concurrent queries, stream aliases and loader admission. Pre-commit checks passed.

This commit declares resources; it does not allocate the kernel execution slot. The referenced TMR branch's 40-byte invocation envelope still needs alignment with the 64-byte K1 ABI before combining consumers.

Dependency and review scope

Draft stack entry 2/5: 2B. Depends on H1.

  • Base: codex/hbg-pr-h1 at 58387071a5291645e78e47957796891f207a3019.
  • Only implementation commit in this PR: 641500ce.
  • Review order: H1 → 2B → context prepare/freeze → H2 → H3.

These draft PRs are stacked in the personal fork, with each PR based on the preceding milestone branch. The stack is pinned to the tested K1 snapshot 21fb15c00ddc82bb716fb80eee07d307e81d5bad; upstream hw-native-sys#2064 is still open and has since advanced. Updating to its final version is separate integration work.

Validation above was completed on this implementation before PR creation. Existing simulation golden checks cover program-mode regression. No idle onboard devices were available; mixed ACLGraph capture/replay, DSV4 CSA device accuracy and comparative performance remain unvalidated.

Query graph-dependent heap, runtime image, Definition and scheduler sizes
without binding or allocating device memory. Aggregate compatible graphs
by region and recompute aligned offsets for one execution slot.

Align common resource validation with TMR while retaining the current K1
wire ABI and program byte semantics. Validate three distinct stream roles
and reject unsupported configuration-only HBG sizing queries.

Cover size overflow, Definition framing, concurrent queries, stream
aliases and loader admission; document Host tensor-data capability rules.
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