mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
Integrated Radeon GPUs on Linux read long prompts on Strata's own int8 expert kernels by default
On an integrated gfx11 GPU under Linux (Radeon 780M / 760M gfx1103, 890M / 880M gfx1150, Strix Halo gfx1151) the engine now sets STRATA_PF_FUSED=1 at start when the user has not set it, so the prompt experts run on Strata's fused int8 kernels instead of llama.cpp's MMQ. Nothing is printed at start; the prefill's own "prompt experts on the fused int8 kernels" line appears once the kernels are taken. STRATA_PF_FUSED=0 is the way back to MMQ (a value the user set is always kept). Discrete cards, computers that also hold a discrete card, and Windows are not touched: the rule is igpu_fused_prompt_default (include/strata/core/arch_defaults.hpp, src/core/arch_defaults.cpp), the same device class as the arena and settle defaults, and it returns false for any non-integrated device and for Windows (the Strix Halo on Windows already has the switch in its own set). Measured on a Radeon 780M (gfx1103, Q2_0 pack, 3 interleaved rounds, prompt tok/s medians, nothing set -> STRATA_PF_FUSED=1): 300 tokens 124.3 -> 124.3, 1,000 159.4 -> 159.5, 2,048 208.8 -> 270.4 (x1.295), 8,192 270.3 -> 304.2 (x1.125). The fused kernels are not taken below the chunk size they need, so short prompts are unchanged. Quality, same card: 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: mean 0.00595 with the fused kernels against 0.00543 with MMQ (ratio 1.096, 95% CI 0.926 to 1.367), top-1 agreement with the FP16 path 97.85% against 97.27%, no non-finite value. Positions 2 to 16 sit at 1.20 times MMQ's (CI 1.01 to 1.38), driven by one prompt. Not run: gfx1150 and gfx1151 (they follow by the class rule). This commit also fixes the settings register entry of STRATA_PF_FUSED (reads, defaults, doc lines) and the rows of docs/AMD_HIP.md, docs/RADEON_780M.md and docs/STRIX_HALO.md.
This commit is contained in:
1 parent
9187ef658b
commit
69394994a9
4 files changed
+119
-28
No files matched your search
+115
-24
@@ -23927,42 +23927,127 @@
|
||||
"name": "STRATA_PF_FUSED",
|
||||
"backends": [
|
||||
"cuda-hip",
|
||||
"hip",
|
||||
"sycl"
|
||||
],
|
||||
"reads": [
|
||||
{
|
||||
"file": "src/core/arch_defaults.cpp",
|
||||
"line": 375,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 399,
|
||||
"line": 279,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 401,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 448,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 450,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 452,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 454,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 456,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 456,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 459,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 462,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults_test.cpp",
|
||||
"line": 462,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/prefill/moe_fused.cu",
|
||||
"line": 692,
|
||||
"line": 714,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/prefill/moe_fused.cu",
|
||||
"line": 703,
|
||||
"line": 725,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/prefill/moe_fused_iq.cu",
|
||||
"line": 2038,
|
||||
"line": 2711,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/prefill/moe_fused_iq.cu",
|
||||
"line": 2057,
|
||||
"line": 2727,
|
||||
"backend": "hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/prefill/moe_fused_iq.cu",
|
||||
"line": 2745,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/prefill/prefill.cpp",
|
||||
"line": 281,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/program/generate.cpp",
|
||||
"line": 10951,
|
||||
"line": 11105,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
{
|
||||
"file": "src/qwen35/q36_engine.cu",
|
||||
"line": 1398,
|
||||
"backend": "cuda-hip",
|
||||
"fn": "getenv"
|
||||
},
|
||||
@@ -23986,10 +24071,16 @@
|
||||
"engine_defaults": [
|
||||
{
|
||||
"file": "src/core/arch_defaults.cpp",
|
||||
"line": 178,
|
||||
"line": 196,
|
||||
"value": "1",
|
||||
"arch": "gfx1151 (Windows)"
|
||||
},
|
||||
{
|
||||
"file": "src/core/arch_defaults.cpp",
|
||||
"line": 376,
|
||||
"value": "1",
|
||||
"arch": "gfx1103 / gfx1150 / gfx1151 (Linux, integrated)"
|
||||
},
|
||||
{
|
||||
"file": "src/core/nv_defaults.cpp",
|
||||
"line": 66,
|
||||
@@ -24001,26 +24092,26 @@
|
||||
"launch_sets": [],
|
||||
"launch_reads": [],
|
||||
"doc_mentions": [
|
||||
"docs/AMD_HIP.md:303",
|
||||
"docs/AMD_HIP.md:745",
|
||||
"docs/AMD_HIP.md:773",
|
||||
"docs/DETAILS.md:1053",
|
||||
"docs/DETAILS.md:1158",
|
||||
"docs/DETAILS.md:1167",
|
||||
"docs/DETAILS.md:1316",
|
||||
"docs/DETAILS.md:1318",
|
||||
"docs/DETAILS.md:1434",
|
||||
"docs/DGX_SPARK_LINUX.md:121",
|
||||
"docs/MULTI_GPU.md:335",
|
||||
"docs/AMD_HIP.md:300",
|
||||
"docs/AMD_HIP.md:742",
|
||||
"docs/AMD_HIP.md:770",
|
||||
"docs/DETAILS.md:1056",
|
||||
"docs/DETAILS.md:1161",
|
||||
"docs/DETAILS.md:1170",
|
||||
"docs/DETAILS.md:1319",
|
||||
"docs/DETAILS.md:1321",
|
||||
"docs/DETAILS.md:1436",
|
||||
"docs/DGX_SPARK_LINUX.md:113",
|
||||
"docs/MULTI_GPU.md:329",
|
||||
"docs/OLDER_GPUS.md:237",
|
||||
"docs/RADEON_780M.md:86",
|
||||
"docs/RADEON_780M.md:103",
|
||||
"docs/release-notes-0.2.0.md:56",
|
||||
"docs/STRIX_HALO.md:203",
|
||||
"docs/STRIX_HALO.md:215",
|
||||
"docs/STRIX_HALO.md:218",
|
||||
"docs/STRIX_HALO.md:227",
|
||||
"docs/STRIX_HALO_WINDOWS.md:89"
|
||||
"docs/STRIX_HALO.md:132",
|
||||
"docs/STRIX_HALO.md:144",
|
||||
"docs/STRIX_HALO.md:147",
|
||||
"docs/STRIX_HALO.md:156",
|
||||
"docs/STRIX_HALO_WINDOWS.md:70"
|
||||
],
|
||||
"first_commit": "47de4a4d83",
|
||||
"first_date": "2026-10-02",
|
||||
@@ -24029,7 +24120,7 @@
|
||||
"last_date": "2026-11-05",
|
||||
"status": "default",
|
||||
"owner": "core",
|
||||
"note": "[auto] on by default for some GPU architectures only (gfx1151 (Windows) src/core/arch_defaults.cpp:178=1; sm_121 src/core/nv_defaults.cpp:62=1); opt-in elsewhere; the variable overrides it",
|
||||
"note": "[auto] on by default for some GPU architectures only (gfx1151 (Windows) src/core/arch_defaults.cpp:196=1; gfx1103 / gfx1150 / gfx1151 (Linux, integrated) src/core/arch_defaults.cpp:376=1; sm_121 src/core/nv_defaults.cpp:66=1); opt-in elsewhere; the variable overrides it; =0 keeps MMQ",
|
||||
"retire_after": "",
|
||||
"retired_in": ""
|
||||
},
|
||||
|
||||
+1
-1
@@ -297,7 +297,7 @@ them in the server config's `env`, or in the shell.
|
||||
| Switch | Cards | Default | Effect |
|
||||
| --- | --- | --- | --- |
|
||||
| `STRATA_HIP_WMMA` | gfx12; gfx11 on request | gfx12 Linux: on with int8 KV. Windows and gfx11: `=1` | QSA prompt attention on the matrix cores. `=0` off; `=auto` takes it only for batches of `STRATA_HIP_WMMA_MIN_Q` (64) or more queries. Not bitwise: greedy text can differ from about token 50 on. |
|
||||
| `STRATA_PF_FUSED` | gfx12 native IQ packs | gfx12 Linux: on for IQ3_S, IQ3_XXS and Q2_0 gate/up. IQ2 formats and Windows: `=1` | Prompt experts on int8 matrix-core kernels instead of MMQ. `=0` keeps MMQ; `STRATA_PF_FUSED_NATIVE=0` keeps MMQ with the flag set. |
|
||||
| `STRATA_PF_FUSED` | gfx12 native IQ packs; integrated gfx11 | gfx12 Linux: on for IQ3_S, IQ3_XXS and Q2_0 gate/up. Integrated gfx11 on Linux (Radeon 780M / 760M gfx1103, 890M / 880M gfx1150, Strix Halo gfx1151): on. IQ2 formats on gfx12, discrete gfx11 and Windows (the Strix Halo on Windows has it in its own set): `=1` | Prompt experts on int8 matrix-core kernels instead of MMQ. `=0` keeps MMQ; `STRATA_PF_FUSED_NATIVE=0` keeps MMQ with the flag set. Radeon 780M, Q2_0: prompt x1.30 at 2K tokens and x1.13 at 8K, no change at 300 and 1,000 tokens; forced-token KL against the FP16 path (24 prompts of 2,048 tokens, 64 tokens each) 0.0060 against 0.0054 for MMQ (ratio 1.10, 95% CI 0.93 to 1.37). The 890M / 880M and Strix Halo take it by the same rule and were not run. |
|
||||
| `STRATA_SCORES_THREAD` | gfx12, gfx1100 | gfx12: on; gfx1100: `=1` | Exact long-prompt QSA scorer (below). `=0` off. |
|
||||
| `STRATA_SELECT_WMMA=1` | gfx12 | Off | Matrix-core block scorer for the QSA top-k; selects slightly differently |
|
||||
| `STRATA_HC_Q8` | gfx12, gfx1151 | On | 8-bit hyper-connection weights; `=0` restores the bf16 read ([below](#strix-halo-8-bit-hyper-connection-weights-default-on-gfx1151)) |
|
||||
|
||||
+2
-2
@@ -83,7 +83,7 @@ greedy tokens, 3 of 3 pairs), with the greedy token ids unchanged. They are the
|
||||
|
||||
On by default on the Radeon 780M (`gfx1103`, integrated, Linux; AMD_HIP.md, "Integrated GPUs"): the engine sets `STRATA_HIP_WMMA`, `STRATA_PF_GEMM`,
|
||||
`STRATA_PA_FAST`, `STRATA_SELECT_WMMA` and `STRATA_HC_UPMIX` itself. `STRATA_IGPU_PROMPT_SET=0` turns the whole set off, `NAME=0` one switch. The 880M / 890M
|
||||
(`gfx1150`) and Windows keep it off (no hardware / not tested); `STRATA_IGPU_PROMPT_SET=1` turns it on there. `STRATA_PF_FUSED` stays opt-in.
|
||||
(`gfx1150`) and Windows keep it off (no hardware / not tested); `STRATA_IGPU_PROMPT_SET=1` turns it on there. `STRATA_PF_FUSED` (the prompt experts on Strata's own int8 kernels instead of llama.cpp's MMQ) is on by itself on the 780M under Linux; `STRATA_PF_FUSED=0` keeps MMQ. Q2_0, 3 interleaved rounds: prompt x1.30 at 2K tokens and x1.13 at 8K, no change at 300 and 1,000 tokens; forced-token KL against the FP16 path 0.0060 against 0.0054 for MMQ (24 prompts, 64 tokens each, ratio 1.10, 95% CI 0.93 to 1.37).
|
||||
|
||||
Measured (021-minipc, P2006, Q2_0, fresh engine per run, 10 interleaved rounds, 6 complete pairs): prompt 1K 98.5 -> 157.3 tok/s (x1.60, 6/6 pairs faster),
|
||||
4K 115.1 -> 233.3 (x2.03, 6/6), decode 22.02 -> 21.99 (code) and 15.09 -> 15.05 (story) (x0.999), greedy token ids identical in 6 of 6 pairs.
|
||||
@@ -100,7 +100,7 @@ export STRATA_HIP_WMMA=1 # prompt attention on matrix cores
|
||||
export STRATA_PF_GEMM=1 # the prompt's FP16 projections on the WMMA GEMM
|
||||
export STRATA_PA_FAST=1 # prompt attention with single FP16 q and p
|
||||
export STRATA_SELECT_WMMA=1 # the block scorer on matrix cores
|
||||
export STRATA_PF_FUSED=1 # the prompt experts on matrix cores (neutral at 4K here: 246 vs 248)
|
||||
export STRATA_PF_FUSED=1 # the prompt experts on the fused int8 kernels (on by default; =0 keeps MMQ)
|
||||
export STRATA_HC_UPMIX=1 # the hyper-connection up projection with its epilogue
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ export STRATA_PREFILL_STREAM_MIN=128 # prompt reads of 128-1,023 tokens on the
|
||||
|
||||
`STRATA_PF_GEMM`, `STRATA_HC_UPMIX`, `STRATA_PA_FAST`, `STRATA_HIP_WMMA` and `STRATA_SELECT_WMMA` together are one opt-in on an
|
||||
integrated Radeon: `STRATA_IGPU_PROMPT_SET=1` ([AMD_HIP.md](AMD_HIP.md), "Integrated GPUs"), measured on a Radeon 780M only, where
|
||||
it is the default. `STRATA_PF_FUSED`, `STRATA_PF_SWITCH_MIN_T` and `STRATA_PREFILL_STREAM_MIN` stay opt-in as well.
|
||||
it is the default. `STRATA_PF_SWITCH_MIN_T` and `STRATA_PREFILL_STREAM_MIN` stay opt-in as well. `STRATA_PF_FUSED` is on by itself on an integrated Radeon under Linux (measured on the 780M only; the Strix Halo takes it by the same rule and was not run there); `STRATA_PF_FUSED=0` keeps MMQ.
|
||||
|
||||
**On Windows the Strix Halo is the exception** (engine 0.1.52 and later): `gfx1151` takes the matrix-core set by itself -
|
||||
`STRATA_HIP_WMMA`, `STRATA_PF_GEMM`, `STRATA_PA_FAST`, `STRATA_HC_UPMIX` and `STRATA_PF_FUSED`, without `STRATA_SELECT_WMMA`
|
||||
|
||||
Reference in new issue
Block a user