Skip to content

ROCm: enable full ROCm backend + native rope/quant/paged-attn + perf - #20

Merged
hanzo-dev merged 2 commits into
mainfrom
rocm-feature-port
Jun 11, 2026
Merged

hanzo-dev merged 2 commits into
mainfrom
rocm-feature-port

Conversation

@hanzo-dev

Copy link
Copy Markdown
Member

Enables the full ROCm backend on main (pairs with hanzoai/ml#9).

main had the rocm feature flag but no implementation. This brings the ROCm enablement, decomplected from integration/native-dub:

  • device_map: Device::Rocm / DeviceLocation::Rocm match arms.
  • QMatMul::RocmQuant arms (qloralinear, unvarbuilder).
  • hanzo-quant: ROCm + new quant-type (IQ/TQ) handling in the gguf path.
  • hanzo-paged-attn: ROCm HIP v1 PagedAttention backend (src/rocm).
  • perf: f16 auto-dtype on ROCm (RDNA3.5 WMMA; bf16 "works" but ~4x slower), and a PagedAttention KV-cache cap for unified memory (the auto 90%-of-VRAM grab hung an 88 GB alloc under WSL).

Verified on gfx1151 (Radeon 8060S): default hanzo run GGUF Q8_0 ~115 tok/s decode, correct output, no hang; safetensors auto-dtype now selects f16.

🤖 Generated with Claude Code

hanzo-dev and others added 2 commits June 11, 2026 14:59
…e-dub)

main had the rocm feature flag but no implementation. Brings the ROCm enablement:
- device_map: Device::Rocm / DeviceLocation::Rocm match arms
- QMatMul::RocmQuant arms (qloralinear, unvarbuilder)
- hanzo-quant: ROCm + new-quant-type (IQ/TQ) handling in the gguf path
- hanzo-paged-attn: ROCm HIP v1 PagedAttention backend (src/rocm)

Pairs with the ml-side ROCm port. GGUF Q8_0 on gfx1151: ~113 tok/s decode, correct.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
- utils/normal.rs: prefer f16 on ROCm (RDNA3.5 WMMA); bf16 'works' but ~4x slower.
  Safetensors auto-dtype decode 12 -> 49 tok/s.
- paged_attention/mod.rs: cap KV cache to model max_seq_len on ROCm unified memory
  (as Metal). The auto 90%-of-VRAM grab was an 88 GB alloc that hangs under WSL.
- utils/mod.rs: enable paged_attn_supported() for ROCm (works with the cap).

Default 'hanzo run' GGUF Q8_0 on gfx1151: ~115 tok/s, correct, no hang.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@hanzo-dev
hanzo-dev merged commit effe8d6 into main Jun 11, 2026
@hanzo-dev
hanzo-dev deleted the rocm-feature-port branch June 26, 2026 18:25
hanzo-dev added a commit that referenced this pull request Jul 16, 2026
ROCm: enable full ROCm backend + native rope/quant/paged-attn + perf
zeekay pushed a commit that referenced this pull request Jul 26, 2026
ROCm: enable full ROCm backend + native rope/quant/paged-attn + perf
hanzo-dev added a commit that referenced this pull request Jul 27, 2026
ROCm: enable full ROCm backend + native rope/quant/paged-attn + perf
zeekay added a commit that referenced this pull request Sep 15, 2026
ROCm: enable full ROCm backend + native rope/quant/paged-attn + perf
breezesamuel added a commit to breezesamuel/engine that referenced this pull request Nov 18, 2026
…w-up)

Completes the four remaining contract items from review:
- Matched baselines: strict prefix cache vs composition planner on the
  identical two-turn shuffled-retrieval fixture - committed as
  hanzo-kv-fabric/results/cacheblend-results.json
- Raw measurements: prefix-only 64/896 reusable (prefill 832) vs
  planner 544/896 (8.5x), compute 832 -> 352 tokens (-57.7%),
  recompute 1 (never-cached doc), silent order violations 0
- HIP-1345 update: results/HIP-1345-update.md proposes the §2.7 status
  addendum (§2.7 = Bounties hanzoai#19-hanzoai#20; the §2.4 label in the first cycle
  was a mislabel - §2.4 is Bounties hanzoai#14-hanzoai#15) - section refs corrected
  in module docs and the bench
- Out-of-scope statement: explicit 6-item list (KV blending math,
  cross-segment attention routing, TTFT/quality parity, tenant pinning
  interplay, runtime eviction, Bounty hanzoai#20)
breezesamuel added a commit to breezesamuel/engine that referenced this pull request Nov 18, 2026
Per the live HIP text: Bounties hanzoai#14-hanzoai#15 = §2.4 (LoRA paging),
Bounties hanzoai#19-hanzoai#20 = §2.7 (non-prefix RAG KV fusion).
breezesamuel added a commit to breezesamuel/engine that referenced this pull request Nov 18, 2026
Per the live HIP text: Bounties hanzoai#14-hanzoai#15 = §2.4 (LoRA paging),
Bounties hanzoai#19-hanzoai#20 = §2.7 (non-prefix RAG KV fusion).
zeekay pushed a commit to breezesamuel/engine that referenced this pull request Nov 21, 2026
Per the live HIP text: Bounties hanzoai#14-hanzoai#15 = §2.4 (LoRA paging),
Bounties hanzoai#19-hanzoai#20 = §2.7 (non-prefix RAG KV fusion).
zeekay pushed a commit to breezesamuel/engine that referenced this pull request Nov 21, 2026
…w-up)

Completes the four remaining contract items from review:
- Matched baselines: strict prefix cache vs composition planner on the
  identical two-turn shuffled-retrieval fixture - committed as
  hanzo-kv-fabric/results/cacheblend-results.json
- Raw measurements: prefix-only 64/896 reusable (prefill 832) vs
  planner 544/896 (8.5x), compute 832 -> 352 tokens (-57.7%),
  recompute 1 (never-cached doc), silent order violations 0
- HIP-1345 update: results/HIP-1345-update.md proposes the §2.7 status
  addendum (§2.7 = Bounties hanzoai#19-hanzoai#20; the §2.4 label in the first cycle
  was a mislabel - §2.4 is Bounties hanzoai#14-hanzoai#15) - section refs corrected
  in module docs and the bench
- Out-of-scope statement: explicit 6-item list (KV blending math,
  cross-segment attention routing, TTFT/quality parity, tenant pinning
  interplay, runtime eviction, Bounty hanzoai#20)
zeekay pushed a commit to breezesamuel/engine that referenced this pull request Nov 21, 2026
Per the live HIP text: Bounties hanzoai#14-hanzoai#15 = §2.4 (LoRA paging),
Bounties hanzoai#19-hanzoai#20 = §2.7 (non-prefix RAG KV fusion).
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