Repository navigation
refactor: use architecture-neutral memory bandwidth terms instead of HBM - #1085
Conversation
|
@mohbasit could you review this when you get a chance? It's a terminology-only rename (HBM to memory bandwidth) with a read fallback for older metadata. Details are in the description. Thanks! |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks Mehdi, +1 on dropping "HBM". I checked the scope against What this does and doesn't touch
|
gabeweisz
left a comment
There was a problem hiding this comment.
Based on Adeem's opinion that this will not break things for other users, I am on board with this change
|
@mehdi-saeedi could we pls update this branch to track the changes in #1077? (staging_agent). These changes have gone through a round of evals so I'd get those into main today and then merge in yours. |
85c35eb to
4cb645b
Compare
|
@tsrikris done. The branch is now rebased on The rebase also covers the HBM mentions #1077 added:
There's no HBM in #1077's Agent code or prompts. All Agent test files plus util, reporting and perf-model tests: 1641 passed. black, ruff, lint-imports and |
|
@mehdi-saeedi can you point this PR to main? It's pointing to another branch by the looks of it |
The memory-bandwidth ceiling was called HBM in code, Agent prompts and docs. That is wrong for GPUs that use GDDR6 or that share LPDDR5X with the CPU, such as the Radeon 8060S (gfx1151) arch file already in utils/arch/. Follow the arch JSON's existing mem_bw_gbps naming instead. - Agent metadata and per-op efficiency: peak_hbm_bw_tbs -> peak_mem_bw_tbs, resolved_peak_hbm_bw -> resolved_peak_mem_bw. Older metadata files that still use peak_hbm_bw_tbs are still read. - Microbench: bench_mem_bandwidth, bench_mem_bandwidth_sweep, include_mem, and sweep JSON keys mem_rows, mem_best, gemm_and_mem. - Prompts, templates, eval rubrics and docs: 'peak memory BW'; 'DRAM' where on-chip storage is contrasted. Unchanged: the GEMM simulator's --hbm_bw flag, report columns and units, arch JSON schema, and the MI300X-specific HBM3 example. Co-authored-by: Cursor <cursoragent@cursor.com>
4cb645b to
854cabe
Compare
|
@tsrikris thanks, fixed. The PR already targeted #1058 and #1051 landed since then and add no new HBM mentions. Agent, util, reporting and perf-model tests: 1641 passed. |
|
@mehdi-saeedi LGTM from Agent PoV. One comment to confirm that the analysis.json generated and used in Hyperloom is not affected. |
|
Looks good to me |
Use "memory" for the bytes moved to and from off-chip memory in the perf-model docstrings, matching mem_bw_gbps and the rest of this rename. Where on-chip storage is contrasted, say "global memory". Co-authored-by: Cursor <cursoragent@cursor.com>
|
@tsrikris confirmed: the
@ajassani agreed, done in ba2f7a1. The perf-model docstrings now say "memory traffic" (and "memory bytes", "memory accounting", "memory read/write"). The two places that contrast on-chip storage (the MoE analyzer prompt and the matching sample report in |
Summary
TraceLens calls the memory-bandwidth ceiling "HBM" in code, Agent prompts and docs. That's accurate for MI300X, but not for GPUs that use GDDR6 (for example R9700) or that share LPDDR5X with the CPU, such as the Radeon 8060S (
gfx1151) arch file already inutils/arch/. This PR follows the name the arch JSON already uses (mem_bw_gbps, next tol1_bw_gbps). It's a rename only: no computed values change."Device memory" was the other candidate, but it's wrong on APUs, where the GPU has no memory of its own. It also clashes with how TraceLens already uses "device" for H2D, D2H and D2D copies.
mem)What changes
peak_hbm_bw_tbs(Agent metadata,category_specific, kernel-fusion metrics)peak_mem_bw_tbsresolved_peak_hbm_bw(per-op efficiency)resolved_peak_mem_bwpeak_hbm_bwargument ofcalculate_efficiencyandcalculate_efficiency_with_validationpeak_mem_bwbench_hbm_bandwidth,bench_hbm_bandwidth_sweep,run_shape_sweep(include_hbm=)(microbench)bench_mem_bandwidth,bench_mem_bandwidth_sweep,include_mem=hbm_rows,hbm_best,"sweep_type": "gemm_and_hbm"mem_rows,mem_best,"gemm_and_mem"The new metadata key is written everywhere in one change. A new helper,
get_peak_mem_bw_tbs(), still readspeak_hbm_bw_tbsfrom older output directories. This matters becausebuild_operation_metricsotherwise falls back to 1 TB/s when the key is missing.The eval rubrics are updated together with the report template, so LLM-graded evals look for "memory BW" in the Hardware Reference section.
What still says HBM after this PR
peak_hbm_bw_tbswhen reading older output directories--hbm_bwflag passed to the GEMM simulator (perf_model.py)perf-model-without-trace.mdand its notebook)Compatibility
nullfor the bandwidth, kernel fusion'sload_arch_confignow falls back to the arch JSON instead of returningNone. The metadata code never writesnull.--update-referenceswas not used).Test plan
pytest tests/test_analysis_agent_utils.py tests/test_analysis_agent_category_utils.py tests/test_analysis_agent_evals.py tests/test_perfmodel_benchmarking.py tests/test_perfmodel_extensions.py tests/test_reporting_utils.py tests/test_util.py: 1180 passed, 25 skipped (torch-only microbench tests)build_operation_metricsandload_arch_configread legacy metadatapytest tests/: 3178 passed. The failures were the same 30 tests, which also fail onmainin my environment because the[jax]extra and setuptools aren't installed thereblack==26.3.1 --check,ruff check --select F401,F841,RET502,RET503,lint-imports,git diff --checkon changed filesmicrobench.pyon a GPU (the renamed functions aren't exercised by CPU-only CI)