Skip to content

[hrx/gfx1151] DSV4.0 Flash optimizations - #170

Open
jammm wants to merge 5 commits into
AMD-Ecosystem:hrx-graph-develop-v2from
jammm:jam/dsv40_hrx_dspark
Open

jammm wants to merge 5 commits into
AMD-Ecosystem:hrx-graph-develop-v2from
jammm:jam/dsv40_hrx_dspark

Conversation

@jammm

@jammm jammm commented Nov 1, 2026 •

Copy link
Copy Markdown

Enable DeepSeek V4 Flash with DSpark on HRX/Loom. Add missing operators, sparse attention and quantized matmul paths, and generalize hyperconnection/indexer kernels. Improve decode with grouped attention, partitioned top-k selection and shared expert weight loads. Consolidate scalar parameter formatting and simplify MXFP4 dispatch setup.

Measured on gfx1151 at 64dc287e using Unsloth DeepSeek V4 Flash 0731 UD-Q4_K_XL and Q8_0 DSpark. Throughput change: (HRX / baseline - 1) * 100. K = 1024 tokens.

Prompt tokens Prefill vs HIP Prefill vs Vulkan Decode vs HIP Decode vs Vulkan
512 +97.7% +20.5% +29.1% +13.5%
1K +93.2% +15.9% +8.2% +5.4%
2K +90.1% +13.3% +10.8% +4.2%
4K +88.6% +13.4% +9.7% +4.1%
8K +99.2% +21.6% +7.9% +4.6%
16K +106.6% +26.4% +21.5% +18.1%
32K +123.3% +42.0% +8.4% +31.0%
64K +168.2% +71.5% +38.1% +70.4%
128K +245.1% +107.9% +64.2% +66.1%
256K +380.6% +132.0% +117.5% +79.1%

Matched uncached prefill; 128 greedy output tokens (127 timed), F16 KV, batch/ubatch 512, draft maximum 3, p_min=0. Weighted warm throughput: four repetitions through 8K, two above; cold requests excluded. Vulkan uses host-preferred mmap. Small gains may overlap measurement variation.

Baselines: gfx11 HIP 0a4e43a6 with a separate local FP32 flash-attention accumulation fix (not included here), and upstream Vulkan 9b8446b9. Tested with TheRock core/devel/libraries/device wheels 10.3.0a20261025 and HRX runtime 7a7f1fe5 plus local runtime fixes.

Validation at 64dc287e: HIP and HRX pass unchanged full-logit gates at all ten contexts through 256K (NLL, KL, top-1 and high-margin predictions). The HIP 256K NLL failure is fixed. HRX passes mixed verification/rollback, 99 native operator cases, independent kernel references and access/race sanitizers. Response divergences qualify against Vulkan on matching histories (top-five tokens, log-probability regret <=0.5).

Cleanup at faddaf48: 264 canonical Loom modules and 258 full-vocabulary logit rows (512/8K contexts) match the measured build exactly. 113 backend and 146 native operator cases passed; broader standalone checks reproduce ten pre-existing SCALE/softmax support failures.

AI-assisted implementation and validation.

jammm added 2 commits November 1, 2026 00:04
Add HRX dispatch and Loom kernels for hyperconnections, sparse attention,
router reductions, and the remaining DeepSeek V4 tensor operations.
Update graph caching, quantized matmul paths, tests, and operator coverage.

Assisted-by: Codex
Select stream and head geometry from tensor shapes. Support gated and scaled
hyperconnection inputs, identity residual mixing, and partial indexer head
tiles. Include gate mode and scale in graph matching and diagnostics.

Add boundary and numerical cases and refresh operator coverage.

Assisted-by: Codex
@jammm
jammm marked this pull request as draft November 1, 2026 13:38
jammm added 2 commits November 2, 2026 13:50
Group attention heads, partition top-k selection and share MXFP4 expert loads across tokens. Preserve accumulation order and cover tails, routing and mask layouts.

Assisted-by: Codex
Reuse float parameter formatting across scalar and hyperconnection operators. Avoid a temporary vector and redundant kernel construction in the MXFP4 path.

Assisted-by: Codex
@jammm
jammm marked this pull request as ready for review November 3, 2026 16:10
Preserve bounded graph and prepared-command caches alongside upstream weight residency and compilation diagnostics. Keep both dispatch eligibility checks and both branches' test coverage.

Assisted-by: Codex
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