feat(frontend): emit per-region hbm_sizes alongside hbm_addrs#60
Merged
Conversation
Expose each HBM region's authoritative byte size (inp.hbm_size) as a parallel name->bytes map in the decoder and vision compile results. Downstream tooling (the simulator's weight-manifest generator) can then size weight / KV / activation regions - including KV stores, which tensor_layouts omits - without recomputing the MXFP8 padding. Additive result key; back-compatible with existing consumers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The decoder and vision compile results already return
hbm_addrs(region name → HBM base offset). This adds a parallelhbm_sizesmap (name → byte size, read straight off eachInputVar.hbm_size) so downstream tooling can size every persistent HBM region — including theK_stored_*/V_stored_*KV stores, whichtensor_layoutsomits because it only covers input tensors — without recomputing the MXFP8 padding.It is an additive result key built in the same loop that already constructs
hbm_addrs, at both emission sites (decoder and vision encoder). No existing field changes, so existing consumers are unaffected.Consumed by the simulator's new weight-manifest generator to build kind-tagged capacity-model manifests (weight / KV / activation regions). Without it the generator still works but falls back to
tensor_layouts+ address-deltas for sizing, which cannot size KV stores exactly.