mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1479] HIP: STRATA_HEAD_MIX_MULTI / STRATA_ONE_TOKEN_COMMIT are hard-off; as opt-ins head-mix is exact and +0.4% decode on R9700 (patch inside) #597
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#597
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jkuepker on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1479
Three paths ported from eddoursul's fork (F7) are compiled to
return falseon HIP:head_mix_multi_enabled()insrc/core/verify.cpp(STRATA_HEAD_MIX_MULTI)head_mix_multi_ongate inMtpDrafter::record_restinsrc/core/mtp.cppone_token_self_commit()insrc/core/verify.cpp(STRATA_ONE_TOKEN_COMMIT)That means nobody can try them on AMD without a rebuild. I patched them into HIP opt-ins (
=1turns them on; the default stays off on HIP and CUDA is unchanged) and measured them on an R9700 (gfx1201):STRATA_HEAD_MIX_MULTI=1STRATA_ONE_TOKEN_COMMIT=1Decode was measured with 3 fixed greedy prompts, 300 tokens and 3 rounds through the server, with a spread of 0.1-0.2% between server starts.
The gain is small, but it is exact and free. A default-on for gfx12 (or at least the opt-in) seems reasonable. Patch:
Not included: the same treatment for
STRATA_MTP_SHARED_BRANCHinmtp.cppdoes not work on HIP. With=1, every request fails withmtp: the shared expert's branch, because thecudaEventRecord(sh_fork_)/cudaStreamWaitEvent(side_)pair fails, andsh_fork_/side_look like they are never created on HIP. That gate has to stayfalseunless the side stream is ported.Environment: Strata v0.1.40.3 (
d5ea713), Linux, AMD Radeon AI PRO R9700 (gfx1201, 32 GB), Ryzen 9 9900X, 30 GB RAM, TheRock ROCm 7.14.0a20260612 (STRATA_ROCM_VERSION), Coder IQ1_M,--resident-experts,STRATA_HIP_WMMA=1,--prefill auto:32768, all 12,288 experts in VRAM.Quality check used for every variant: greedy needle retrieval at ~4K / ~16K / ~57K tokens plus a code task. All 4 pass, and the 4 answer hashes are identical to the baseline.
@phoenixclyde commented on GitHub (Oct 9, 2026):
The mirror image of this one: while
head_mix_multi_enabled()andone_token_self_commit()are hard-off on HIP,Prefill::arm_cpu_share()is hard-on there for the same underlying reason - the gfx906 compat build does not defineSTRATA_USE_HIP, so its#if !defined(STRATA_USE_HIP)atsrc/prefill/prefill.cpp:1839takes the CUDA branch and arms the CPU share by default (and prints the banner).src/core/expert_cache.cpp:5-6states that build explicitly, and guards the same question with#if defined(STRATA_USE_HIP) || defined(STRATA_HIP_GFX906); seven other sites use that form. Worth folding into the gate audit you are doing here: the failure mode is not only "cannot opt in", it is also "something AMD was never meant to get is on by default".Measured effect on a 4-token prompt (MI50 32 GB): 197 experts computed on the CPU, prefill 928.3 vs 929.5 ms, output token ids identical. Fix: one line at
prefill.cpp:1839(#1732)@Niko1221 commented on GitHub (Oct 10, 2026):
Added as HIP opt-ins (your patch, you are credited as co-author): STRATA_HEAD_MIX_MULTI=1 and STRATA_ONE_TOKEN_COMMIT=1, default off. Tested on 2x R9700, IQ3_S, both set vs unset, 8 interleaved pairs: answers identical in all runs; decode speed was not distinguishable (-3.5% prose, -9.5% code, +7.7% 4K prompt, each with 3-5 of 8 pairs faster) on a box shared with other jobs. So exact, and no gain we can show here; opt-in it stays.
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.