Skip to content

perf(amdgpu): LDS-cache efc_force in tiled_wc Phase 4b#81

Open
zhihuidu-amd wants to merge 1 commit into
amd-integrationfrom
perf/fix4b-lds-efc-force-cache-tiled-wc-v2
Open

perf(amdgpu): LDS-cache efc_force in tiled_wc Phase 4b#81
zhihuidu-amd wants to merge 1 commit into
amd-integrationfrom
perf/fix4b-lds-efc-force-cache-tiled-wc-v2

Conversation

@zhihuidu-amd

@zhihuidu-amd zhihuidu-amd commented Jul 2, 2026

Copy link
Copy Markdown

Summary

Cache efc_force in LDS during Phase 4a, then read from LDS in Phase 4b
(J^T @ efc_force inner loop), eliminating repeated HBM round-trips.

Approach

The 8 lanes per env already write efc_force COOP-strided during Phase 4a.
This patch stores efc_val into efc_force_lds at the same time (value is
hot in registers), then Phase 4b reads from LDS instead of HBM.

LDS budget: (ENVS=8, MAX_CON=64) float32 = 2 KB — well within 64 KB limit.
Zero additional VGPR cost. Tail path handles n_con > 64 via HBM fallback.

Correctness

efc_force_lds is filled before the existing block.sync() that Phase 4b
already depends on — no additional synchronization needed.

Validation

Pre-submit CI: build Genesis-Embodied-AI#380, all tests PASSED. Awaiting code review.

Replace per-lane HBM reads of efc_force in the J^T@efc_force inner loop
with cooperative LDS fills during Phase 4a, then fast LDS reads in Phase 4b.

The 8 lanes per env already write efc_force to HBM in COOP-strided order
during Phase 4a. This patch stores efc_val into efc_force_lds at the same
time (while the value is hot in registers), then Phase 4b reads from LDS
instead of HBM for the inner j_c accumulation loop.

LDS budget: (ENVS=8, MAX_CON=64) float32 = 2 KB, well within the 64 KB
per-workgroup LDS limit on gfx942. No VGPR overhead vs the HBM path.

Why LDS over register cache (Fix-4b):
- Register cache consumed 8*8=64 VGPRs per lane, hurting occupancy on MI325X
- LDS cache uses shared on-chip memory with zero VGPR cost
- LDS latency (~100 cycles) vs HBM (~600 cycles) still gives significant speedup
- Tail path handles n_con > 64 via HBM fallback (uncommon on humanoid robots)

Correctness: efc_force_lds is filled before the existing block.sync() that
Phase 4b already depends on, so no additional synchronization is needed.
@zhihuidu-amd zhihuidu-amd reopened this Jul 2, 2026
@zhihuidu-amd

Copy link
Copy Markdown
Author

/run-ci

1 similar comment
@zhihuidu-amd

Copy link
Copy Markdown
Author

/run-ci

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