mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2230] [Engine] Fix mixed-gfx HIP prefill GEMM precision selection #3936
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#3936
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2230
Author: @PJGV333
Created: 10/13/2026
Status: 🔄 Open
Base:
main← Head:fix/hip-mixed-gpu-prefill-issue-690-703-pr📝 Commits (1)
835e105fix(hip): select prompt FP16 per gfx103x device📊 Changes
8 files changed (+732 additions, -15 deletions)
View changed files
📝
CMakeLists.txt(+38 -0)📝
docs/AMD_HIP.md(+7 -1)📝
include/strata/prefill/gemm.hpp(+4 -3)📝
src/prefill/gemm.cu(+15 -8)📝
src/prefill/kernels.cu(+2 -2)📝
src/prefill/prefill.cpp(+1 -1)➕
tests/hip/multigpu_prefill_dispatch.cpp(+163 -0)➕
tests/hip/multigpu_prefill_gemm_dispatch.cpp(+502 -0)📄 Description
Problem and result
Issues #690 and #703 report
no kernel image is available for execution on the deviceduring long-history / multi-chunk prefill on heterogeneous AMD layer splits. The reports includegfx1100 + gfx1030andgfx1201 + gfx1031; they do not identify a root cause. In #690, settingSTRATA_HIP_PROMPT_F16=1unblocked the reporter's tested case, but the setting changes prompt GEMM precision on both GPUs.This opt-in change preserves the historical global
STRATA_HIP_PROMPT_F16=1behavior and addsSTRATA_HIP_PROMPT_F16=allas an explicit alias plusSTRATA_HIP_PROMPT_F16=gfx103x, which selects FP16 prompt GEMMs only on gfx103x devices. Other architectures retain the default BF16 path. This is a per-device precision-selection option; it does not claim to diagnose or fix the reported long-prefill kernel-image failure.Related discussion
Approach
STRATA_HIP_PROMPT_F16=1selection global; keep its historical first-character behavior.=allis a new explicit alias, not a historical alias.=gfx103x: FP16 only for HIP devices whose architecture name begins withgfx103; other devices continue to use BF16.allalias.Validation
Prepared local PR head:
835e1053073c0c0ddbb8d31c65c65974b3341776, based on upstreammain9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4(v0.2.1.4; engine0.1.46.3). GitHub still reports upstreammainat9de04cd; no new upstream commit affects the patch paths. The tested candidate was1ab2ca2bf4ba551a030416a2c19de537fc7ab48e; the prepared head has the identical source tree (e898c5ed…) and only corrects the stale “unverified” commit message.Passed:
gfx1201;gfx1031,STRATA_PREFILL_MMQ=ON. Reproduction configuration:hip_prefill_hipblaslt_gemmandhip_prefill_rocblas_gemm, because tuning tables were unavailable.gfx1201) + RX 6750 XT (gfx1031), dual-GPU IQ3_S inference with MTP active showed BF16 ongfx1201and FP16 ongfx1031for=gfx103x. The control/candidate matrix covered default,=1,=all,=gfx103xandSTRATA_RDNA2_SGEMM=1; default and=1were also checked on onegfx1201GPU.323; that matrix was not repeated. In a separate, focused dual-GPU run on the RX 9070 XT (gfx1201) + RX 6750 XT (gfx1031), one 9,035-token API prompt (same 0.2.x base9de04cd, model, hardware and environment;--prefill 8192,--max-context 16384, temperature 0, max 64 generated tokens, reasoning disabled) completed on the candidate: HTTP 200,finish_reason=stop, 24 output tokens, answer included323. The prompt is reproducible as 290 repetitions ofDato de prueba: la Luna orbita la Tierra y la Tierra orbita el Sol. Esta frase repetida sirve únicamente para aumentar el prefill.followed byCalcula 17 por 19. Responde en español con una frase breve de exactamente veinte palabras que empiece con el resultado 323.; the raw text was 9,023 tokens and the API prompt, including template, was 9,035. The logs confirm BF16 ongfx1201and FP16 ongfx1031, MTP active with 8/20 drafts accepted, and no HIP/BLAS errors.7.2.10-1-cachyos, ROCm7.2.4, HIP7.2.53211, AMD Clang22.0.0git, driver7.2.10-1-cachyos. Candidate timing for that single request: prefill 9,035 tokens in 7,488 ms (1,206.6 tok/s); decode 24 tokens in 701 ms (34.2 tok/s). These are descriptive measurements, not a benchmark or a speedup claim.git diff --checkpassed. No performance claim is made from these smoke tests.Failed:
9de04cd) was givenSTRATA_HIP_PROMPT_F16=gfx103xbut its old parser treats that value as off, leaving both devices on BF16. It returned HTTP 503 after the engine loggedprefill gr_mix_r: no kernel image is available for execution on the device, followed byrocBLAS error: Could not initialize Tensile host: unordered_map::atand engine exit-6. The server adds generic advice that such exits can indicate OOM; the kernel journal had no OOM/reset entry in this interval, so I cannot assign that cause. No prefill/decode throughput was reported. This is an observed upstream failure in one attempt; its cause and repeatability remain unknown. The candidate completed the identical request.STRATA_HIP_PROMPT_F16=1and a 2,262-token prompt returned HTTP 503 after non-finite logits andprefill gr_silu: no kernel image is available for execution on the device. That same case passed on a later fresh run. Its cause remains unknown and it is not classified as fixed.finish_reason=length). It was not counted in the numeric A/B matrix, which was rerun withreasoning_effort=noneto obtain comparable numeric replies.Not run:
nvccunavailable;icpx/dpcppunavailable). Applicability of SYCL to the touched shared source should be confirmed by maintainers.Limits
This validates the per-device option and focused HIP dispatch on one
gfx1201 + gfx1031system. CMake warns thatgfx1031is not validated by maintainers; each HIP build log also contains 3,701 compiler warnings despite completing successfully. It does not establish the root cause or fix for #690/#703, and the intermittent failure remains unexplained. The project asks that a PR stay draft while required backend builds are unavailable. Existing upstream CI workflows do not provide an engine CUDA/HIP/SYCL build, so targeted maintainer/CI help is requested. Sanitized logs and an A/B runner can be supplied; local raw logs/scripts are not attached because they contain machine-specific paths.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.