Files
Strata/cmake/backends
Niko1221 563e0fa037 prefill: the hyper-connection up-mix runs on the FP16 matrix-core builtin when the prompt runs FP16 in and out
The previous commit skipped the fused up-mix (STRATA_HC_UPMIX) whenever STRATA_HIP_PROMPT_F16=1, which is correct but gives up
its speed. gr_upmix_kernel now has an FP16 path, taken when the activation image is FP16 (g_act_f16, set by Prefill::init with
Gemm::set_f16_io): the lo16 fragments are read as FP16 and multiplied on __builtin_amdgcn_wmma_f32_16x16x16_f16_w32, the BF16
W_up rows are converted to FP16 while they are staged in LDS (bf_to_hf_conv, the conversion the FP16 GEMM route applies; a BF16
value is exact in FP16 above 6e-5), FP32 accumulate in the same K order as the BF16 kernel. The guard of the previous commit
is removed again. With FP16 io off the kernel takes the BF16 path it took before (one uniform branch).

New test hip_gr_upmix_parity (src/prefill/gr_upmix_parity.cu on HIP; exit 77 off gfx11): the BF16 cases against the default
pair (the 20 sizes from T = 1 to 8192 pass on a Radeon 780M) and six FP16-io cases (T = 33 to 8192) against an FP64 reference and
against the FP16 pair: the fused kernel's error against FP64 is 1.6e-7 to 3.6e-7 of the largest value, the pair's (its GEMM
output rounded to FP16) 6.2e-5 to 1.2e-4.

Radeon 780M, Q2_0 pack, forced-token KL against the FP16 path (24 prompts of 2,048 tokens, 64 forced tokens each, draft-cost
table fixed, repeat arms equal their first run byte for byte), STRATA_HIP_PROMPT_F16=1: fused experts beside it 0.00598 (ratio
to the MMQ arm 1.101, 95% CI 0.954 to 1.248, top-1 97.53% against 97.27%); alone 0.00593 (ratio 1.091, CI 0.968 to 1.231, top-1
97.46%). Before this change with the up-mix skipped: 1.075 and 0.914; before either: 166 and 171 times. Prompt tok/s medians of 3
rounds, ratio to nothing set: fused + FP16 io 300 tokens x1.111, 1,000 x1.152, 2,048 x1.628, 8,192 x1.450; FP16 io alone
x1.114 / x1.152 / x1.193 / x1.251 (with the up-mix skipped: x1.087 / x1.113 / x1.569 / x1.389 and x1.088 / x1.113 / x1.161 / x1.207).
Without STRATA_HIP_PROMPT_F16=1 nothing changes: the nothing-set arm is byte-identical to the old default.
2026-11-12 21:25:04 +01:00
..