roofline: emit raw per-tensor facts for DDR byte accounting (single + fused)#48
Draft
roberteg16 wants to merge 2 commits into
Draft
roofline: emit raw per-tensor facts for DDR byte accounting (single + fused)#48roberteg16 wants to merge 2 commits into
roberteg16 wants to merge 2 commits into
Conversation
Fused rows previously carried a group HBM byte total computed in-tree. Instead, emit raw per-fused-node facts -- each tensor's byte count, a storage id (view_src root, so aliasing is visible) and a source tensor id -- and let the consumer (rocm-scripts tools/roofline) compute external in/out. This lets the consumer apply the exclusion policy it owns: skip no-op views (VIEW/RESHAPE), drop in-place destinations (e.g. SET_ROWS/CPY writing their own dst), exclude internal tensors, and dedup reads by source. It also matches how non-fused rows already work (producer reports facts, consumer sums). Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Non-fused rows already emit dst/src byte counts; also emit the dst storage id, per-source ids and per-source storage ids (all already captured by fill_head_record). This lets the consumer apply the same in-place-destination rule to single kernels as to fused ones -- e.g. a standalone CPY or SET_ROWS no longer has its write target (dst passed in as a source) double-counted. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
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.
What
The HIP roofline profiler emits raw per-tensor facts instead of computing HBM byte totals in-tree. For every tensor — on fused nodes and on the top-level (single-op) row — it reports: byte count, a storage id (the
view_srcroot, so the consumer sees which tensors alias the same buffer), and a source tensor id. The consumer (rocm-scriptstools/roofline) computes external in/out from those facts.Improvements
VIEW/RESHAPE), in-place copy/scatter destinations (CPY/SET_ROWSpass their own output buffer in as a source — written, not read), and internal tensors. This fixes real double-counts — the KV-cache write was counted twice, in both fused and standaloneSET_ROWS/CPY.Two commits: (1) raw facts for fused nodes + drop the in-tree fused computation; (2) emit the same ids on non-fused rows so single kernels get the same treatment.
Companion consumer PR: FaaSApps/rocm-scripts#682.
A/B on Qwen2.5-3B / gemma-3-12B / Qwen3.6-35B: only view / in-place-destination cases change (e.g.
SET_ROWS−49%, standaloneCPY−33%); every other row is byte-identical.