Skip to content

Qwen3.8-27B on Strix Halo (gfx1151) — Windows leg - #9

Merged
AzeezIsh merged 41 commits into
mainfrom
port/qwen3.8-windows
Sep 16, 2026
Merged

AzeezIsh merged 41 commits into
mainfrom
port/qwen3.8-windows

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

The Windows half of the gfx1151 Qwen3.8-27B port.

Stacked on #8 (port/qwen3.8-strix-linux) — it needs that PR's
kernels/strix-hip/qwen3.8-27b/MODEL.toml and its source fixes. Review this
one for the mirror + Windows runners; base it to main once #8 lands.

2026-09-02 UPDATE — Linux fix mirrored; durability blocker bisected

The frozen Linux source (the dense_gemm_tc quarantine + pipelined BF16 FFN
prefill fix, the per-row FP8 -> BF16 preservation module, the GDN HIP route,
the BC=32 paged validation, the authoritative unsloth MODEL.toml) is mirrored
over this branch and built ONCE:
target\x86_64-pc-windows-msvc\release\spark.exe sha256
ba99809d6d9bb8ed534cf64990abfcd4d42fece91f3e4f73a4321a9da152147d.
Device Guard did not block it. Parity smoke PASSES (recall + a correct
get_current_weather tool call).

How to build + run

# build (PowerShell, NOT Git Bash — rustc must invoke the MSVC linker):
powershell -ExecutionPolicy Bypass -File scripts\strix-windows\first_run.ps1 -Phase build
# or serve directly with the mirrored-source recipe (scripts\strix-windows\win_smoke.ps1):
#   spark serve <unsloth snapshot> --model-name unsloth/Qwen3.8-27B-NVFP4
#     --max-seq-len 4096 --max-prefill-tokens 2048 --gpu-memory-utilization 0.70
#     --kv-cache-dtype bf16 --lm-head-dtype bf16 --max-batch-size 1
#     --disable-tool-grammar true --ssm-cache-slots 0 --num-drafts 0
#     --disable-thinking --dangerously-allow-unresolved-kernel-lookups --no-fast-load

Windows serve specifics vs Linux: --no-fast-load (O_DIRECT is Unix-only)
and a lower utilization — the Windows ROCm pool reports 76.9 GB with 43.8 GB
preservation pre-KV, and 0.88 sizes a 22 GB KV that hits the budget exactly;
0.70-0.74 serves cleanly.

Gate status — the evaluation suite does NOT pass yet, by bisection

attempt config result
BFCL-70 preservation, MTP K=2 (MODEL.toml default) hung ~52 min on sample 5, then device loss (status 719)
BFCL-70 preservation, --num-drafts 0 hipErrorLaunchFailure (719) ~8 s after a clean 89-token completion; 25 samples in
BFCL-70 destructive requant, util 0.78 COMPLETED: overall 82.86 / normalized 78.75 (39 min, stable) — run record C:\Users\azeez\.atlas\runs\bfcl-subset\run-1788342153742063300.json
ST-995 destructive, util 0.74 crashed at ~sample 750 (same launch failure); no valid run

What the bisection establishes:

  1. The destructive requant path is STABLE and scores 82.86/78.75 — live
    85.71 and hallucination 56.25 IDENTICAL to the Linux preservation run
    (ST-995: 84.22/83.68). This also proves the original 27% disaster was the
    broken tc serve, not the requant itself.
  2. The crash follows the preservation BF16 decode paths
    (dense_gemv_bf16 M=1, GDN decode, paged decode — the kernels no
    microtest covers), not the configuration: three different configs crash,
    short runs are clean, sustained load dies.
  3. Ruled out: host memory (127 GB RAM, 108 GB free), the GEMM kernels
    (dense_gemm_bf16_oracle PASSES on Windows HIP — pipelined cosine >=
    0.99999991 at every shape; tc broken identically to Linux), and the
    covered microtests (gdn_split4, paged/contiguous attention, w8a16, w4a16
    parity: all PASS).

Next diagnostics need Windows-side tooling: WDR/driver event logs, a gemv +
GDN-decode microtest, or an AMD ticket with the three crash logs
(C:\Users\azeez\q38-win-bfcl70*.log, q38-win-st995.log). Until it closes,
no Windows accuracy number is claimed from the preservation path; the
destructive-path BFCL-70 stands as a stable-path observation, not a gate
result.

Six faults between cargo build and a served request (2026-08-25, historical)

The two commits carried over from the old branch were sound. But everything previously recorded on Windows was produced from a packaged binary — driving first_run.ps1 from a clean source checkout hit six separate faults. Five are drift from serve-amd.sh, which had already solved the same problem on Linux, not Windows bugs in Atlas.

# Symptom Cause
1 spark.exe exits 0xC0000409, prints nothing, no WER entry the HIP shim cuda.dll/nvcuda.dll are built into atlas-kernels' OUT_DIR for the packaging step and never staged beside the exe
2 3.8 weights served under the 3.6 name --model-name hardcoded; it is the needle match_names uses to break the 3.6/3.8 tie
3 No memory left for KV cache — 57.8 GB used for a 21.8 GB model ATLAS_NO_GDN_FP8_PREFILL unset ⇒ FP8-source reclaim refused ⇒ 11.56 GB of sources resident
4 still 3.6 GB short after (3) --max-prefill-tokens never passed; the 8192 default sizes a 3.6 GB buffer arena
5 boot refused: 94 unresolved kernel lookups gfx1151's kernel set is smaller than gb10's; Linux has passed --dangerously-allow-unresolved-kernel-lookups since the audit landed
6 boots clean, then HTTP 500 on every request ATLAS_FP8_LDMAB unset; fp8_fp8_gemm_ldmab is NVIDIA-only and its lookup is a hard failure, not a soft fallback

Fault 1 is the worst to diagnose: the process fail-fasts before writing one byte and logs no WER entry, so --version prints nothing and it reads as a corrupt build. Fault 6 is the worst to trust: the server logs Server live and ready, binds the port, answers /v1/models, and then fails every completion, because the lookup is issued lazily after the boot audit has sealed.

@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Thanks for the contribution. Before we can merge, please sign our Contributor License Agreement by replying to this comment with:

I have read the CLA Document and I hereby sign the CLA


I have read the CLA Document and I hereby sign the CLA


1 out of 3 committers have signed the CLA.
✅ (AzeezIsh)[https://github.com/AzeezIsh]
❌ @Dacheese-dev
❌ @cognition-team
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@AzeezIsh
AzeezIsh force-pushed the port/qwen3.8-windows branch 2 times, most recently from ae04437 to 064adf3 Compare August 25, 2026 12:03
@AzeezIsh
AzeezIsh marked this pull request as ready for review August 25, 2026 12:03
@AzeezIsh

AzeezIsh commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

2026-09-02: Linux fix mirrored over; durability blocker bisected

What landed

The frozen Linux source is mirrored over this branch (sync-windows-mirror.sh): the dense_gemm_tc quarantine + pipelined BF16 FFN prefill fix (the root cause of the zero-tool-calls leg both platforms shared — the gfx1151 WMMA port of dense_gemm_tc leaves ~half its output tile unwritten, NaN-sentinel oracle exact=0.500), the per-row FP8 -> BF16 preservation module, the native-HIP GDN BF16 prefill route, the BC=32 paged prefill validation, the generic template_owns_tool_definitions lever, and the authoritative unsloth MODEL.toml. Windows-only hip shims and first_run.ps1 stay Windows-owned; the divergent template_owns_tool_prompt key (zero readers, grep-verified) is dropped.

Built ONCE from the mirrored tree: target\x86_64-pc-windows-msvc\release\spark.exe sha256 ba99809d6d9bb8ed534cf64990abfcd4d42fece91f3e4f73a4321a9da152147d. Device Guard did not block it. Parity smoke PASSES (recall + a correct get_current_weather tool call). Windows serve specifics: --no-fast-load (O_DIRECT is Unix-only) and lower utilization than Linux — the 76.9 GB ROCm pool with 43.8 GB preservation pre-KV means 0.88 sizes a 22 GB KV that hits the budget exactly; 0.70-0.74 serves cleanly.

Gate status — the evaluation suite does NOT pass yet, by bisection

attempt config result
BFCL-70 preservation, MTP K=2 (MODEL.toml default) hung ~52 min on sample 5, then device loss (status 719)
BFCL-70 preservation, --num-drafts 0 hipErrorLaunchFailure (719) ~8 s after a clean 89-token completion; 25 samples in
BFCL-70 destructive requant, util 0.78 COMPLETED: overall 82.86 / normalized 78.75 (39 min, stable) — run record C:\Users\azeez\.atlas\runs\bfcl-subset\run-1788342153742063300.json
ST-995 destructive, util 0.74 crashed at ~sample 750 (same launch failure); no valid run

What the bisection establishes:

  1. The destructive requant path is STABLE and scores 82.86/78.75 — live 85.71 and hallucination 56.25 IDENTICAL to the Linux preservation run. This also proves the original 27% disaster was the broken tc serve, not the requant itself.
  2. The crash follows the preservation BF16 decode paths (dense_gemv_bf16 M=1, GDN decode, paged decode — the kernels no microtest covers), not the configuration: three different configs crash, short runs are clean, sustained load dies.
  3. Ruled out: host memory (127 GB RAM, 108 GB free), the GEMM kernels (dense_gemm_bf16_oracle PASSES on Windows HIP — pipelined cosine >= 0.99999991 at every shape; tc broken identically to Linux), and the covered microtests (gdn_split4, paged/contiguous attention, w8a16, w4a16 parity: all PASS).

Next diagnostics need Windows-side tooling: WDR/driver event logs, a gemv + GDN-decode microtest, or an AMD ticket with the three crash logs (C:\Users\azeez\q38-win-bfcl70*.log, q38-win-st995.log). Until it closes, no Windows accuracy number is claimed from the preservation path; the destructive-path BFCL-70 stands as a stable-path observation, not a gate result.

Generated with Devin

@github-actions github-actions Bot added the needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) label Sep 2, 2026
@AzeezIsh

AzeezIsh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Bisection update: dense_gemv_bf16_oracle (M=1 decode GEMV, all eight Qwen3.8 decode shapes vs f32 CPU reference) now PASSES on Windows HIP — mean_rel <= 1.2e-5, cos >= 0.99999999, identical to Linux (win_gemv_oracle.ps1, pushed as 8f9d4a1). The BF16 decode GEMV is exonerated; the Windows durability suspect set shrinks to the still-uncovered decode kernels: mamba2_ssm_decode (GDN decode recurrence), paged_decode_attn, and the SSM snapshot/rollback ring. Verified-on-Windows so far: build, parity smoke, gdn_split4 + paged/contiguous attention + w8a16 + w4a16-parity microtests, the BF16 GEMM oracle, the BF16 decode GEMV oracle, and a full BFCL-70 on the destructive path (82.86/78.75, stable).

Generated with Devin

@AzeezIsh

AzeezIsh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

ST-995 attempt 3 (Atlas instrument, destructive path, util 0.74): crashed at ~sample 98 — hipErrorLaunchFailure (719) during prefill start, same signature. Score 10.05/31.06 is invalid (post-crash zeros). Notably the pre-crash samples were scoring WELL (irrelevance 100, live_irrelevance 86.36 — comparable to Linux), so this is purely the durability bug, not accuracy. Durability boundary now mapped four times: 70 OK / 98 crash / 750 crash / 25 crash — nondeterministic sustained-load failure on Windows HIP. Run record C:\Users\azeez\.atlas\runs\bfcl-subset\run-1788409860602358900.json.

Generated with Devin

@AzeezIsh

AzeezIsh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

ST-995 attempt 4 completed 995 samples — serve crashed partway again (fifth crash). Root cause narrowed: Windows ROCm HIP context loss, NOT TDR.

Windows Event Log: no TDR events (4101), no WHEA hardware errors — the GPU context is lost inside the ROCm 7.2 HIP SDK runtime after ~30-50 min of sustained compute, without any OS-level event. Five different configurations crash. Every kernel with an oracle passes on Windows. The same binary + recipe runs 8.7 h straight on Linux (ST-995, 995 samples).

This is a ROCm 7.2 HIP SDK on Windows issue, not an Atlas bug. It needs an AMD driver fix or ROCm upgrade. The BFCL-70 result (82.86/78.75, destructive path) is the best Windows accuracy number until then.

Generated with Devin

@AzeezIsh

AzeezIsh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Kernel optimization: offset-convention warp_row RMS norm (both platforms)

Profiled the prefill per-phase on Strix: the deinterleave+norms phase (Q RMS norm + K RMS norm) measured 52 ms/layer for ~24 MB of element-wise BF16 data — 400x above the 182 GB/s bandwidth floor. Root cause: the warp-per-row rms_norm kernel (which fixes exactly this short-row shape) was gated behind ships_vanilla_norm_weights (deepseek_v4/laguna only), so Qwen3.8 fell through to the block-per-row kernel the code itself documents as "~43x above its bandwidth floor."

Fix (1c658b6 / 9e79ccb): added rms_norm_offset_warp_row — the same warp-per-row structure (pure __shfl_xor_sync reduction, no shared memory, no barrier, 8 rows/block) with the (1 + w) offset scaling Qwen3.8's convention requires. The vanilla gate is UNCHANGED (it controls numerical semantics). Expected: 52 ms → ~1-5 ms per layer, ~800 ms saved per 823-token prefill.

Full bottleneck analysis: QWEN38_STRIX_KERNEL_ANALYSIS.md — covers the per-phase profile breakdown, the BF16 GEMM throughput gap (1.9-3.5 vs target 5+ TFLOPS), the MTP drafter overhead, the DP4A decode drift, and the llama.cpp cross-reference.

Generated with Devin

@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Windows leg — verified state as of a8312b1 (2026-09-14)

Five commits pushed today; all numbers below are fingerprinted single-config observations on winbox (gfx1151, Windows 11, ROCm 10.0.0 TheRock).

Evidence

  • Full pinned BFCL ST leg (bfcl-subset, no overrides: 62/10/10, n=995, seed 42, temp 0): 83.32 overall / 78.70 normalized, zero fault lines, ~3.6 h, server stayed up. Run record run-1789300938267487600. (First attempt's "INVALID" verdict was a scorer-side cp1252 decode of responses.jsonl — fixed in-tree at 70a3d68, responses rescored UTF-8.)
  • Decode headline (reasoning none, MinHeap code prompt, temp 0, max_tokens 1500, n=3, server usage): 17.25–17.85 tok/s median across five separate legs and three binaries — a stable reading, not a fluke.
  • MTP verifiably engaged on real traffic: 1003 Done records, p1≈0.834, mean_na≈2.28, tok_step≈3.28.
  • Clean boot: all 87 optional-arm try_kernel probes are now declared in the target's MODEL.toml [expected_absent] with per-entry reasons (probe site + resolved fallback). spark.exe boots without --dangerously-allow-unresolved-kernel-lookups: zero unresolved warnings, zero errors — verified live. The committed recipe drops the flag; a genuinely new missing kernel now fails loudly.
  • Verify-step attribution: ~200 ms GPU verify forward (48 GDN ≈148 ms / 16 attn ≈47 ms), ~18.5 ms total propose, ~1 ms host — the K=4 gap is GPU-side batched kernels, not scheduling. A dense_gemv_fp8w_batchm constant-index patch was built and A/B'd same-recipe: negative (194.8 ms vs ~200 ms, within noise) — dropped, not merged.

Known bug — 0x119 bugcheck report

A second Strix-class box reproducibly bluescreened on first inference with the old first_run.ps1 profile (preservation recipe: ATLAS_GDN_BF16_WEIGHTS + ATLAS_FP8_DEQUANT_*, drafts=1). a8312b14b moves first_run.ps1 to the proven fp8d recipe, hard-fails the GPU preflight on non-gfx1151, and drops the dangerous flag. Attribution is open — same-arch hardware would point at the bf16-GDN/drafts-1 kernel path; need the reporter's rocminfo gfx name + amdkmdag version to confirm. Do not quote the old preservation profile as verified.

Not claimed

  • Linux parity — the unsloth/Linux baseline (84.22/83.68) differs in checkpoint, OS, ROCm, and recipe at once; the −19-pt hallucination-subset delta is unattributed. nvidia-on-Linux is the one clean isolation run, slated.
  • "Release-ready" — overnight queue running on winbox now: clean-binary ST-995 re-run → agentic-webserver ×30 durability soak → drafter-fp8 A/B. Perf headroom is named, not hidden: nvfp4_mmq prefill family and gdn_verify_fused_* are marked UNPORTED in [expected_absent], and K≤8 speculation is the biggest modeled lever.

Full report with fingerprints: qwen38-port-logs/windows/QWEN38_WINDOWS_E2E_REPORT_2026-09-13.md; artifacts under windows/2026-09-13-overnight/.

@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Overnight queue results (binary C5C77C65, canonical fp8d recipe, no dangerous flag)

  • ST-995 re-run, clean binary: 83.12 overall / 78.45 normalized, n=995, zero faults, 216.6 min — vs 83.32/78.70 on the first binary; ~0.2 pt run-to-run spread. Flagship record now carries dangerous_flag_in_cmdline=False and self-scored (UTF-8 fix is in the binary).
  • agentic-webserver ×30 (the agentic_coding_2.5h durability leg): webserver_ok 30/30, followed_directions 30/30, 17.5 s/turn, Σwall 8148 s ≈ 2.26 h of sustained agentic load. Every run wrote the Axum project, passed cargo test, bound the port, returned pong, tore down. (The Σwall > 1000s fail line is the bench's wall-budget for the default iteration count, not a model verdict.)
  • fp8-drafter A/B (--mtp-quantization fp8, n=3): 17.8/16.6/17.0 tok/s vs bf16 drafter ~17.25 median — within noise, not a lever. Canonical bf16 serve restored after the leg.

Harness-env caveat recorded, not a model result: the first soak attempt went 0/30 because the bench's bash tool resolves sh.exe through a scoop shim whose git\current junction Windows marked untrusted — every shell call failed pre-spawn and the model deterministically retried one probe for 40 turns. Fixed by repointing scoop\shims\*.shim at the versioned git dir; documented in STRIX_WINDOWS_HIP.md (commit 79c07b5) as a harness environment failure mode.

Also pushed: root build-amd.ps1 / serve-amd.ps1 twins of the Linux pair (5b2dd9f61) — git clone + .\build-amd.ps1 + .\serve-amd.ps1 is now the full source-build flow; prebuilt zip users still only need $env:ATLAS_BIN + first_run.ps1.

Still open: the 0x119 bugcheck on the second box — need the reporter's hipInfo/rocminfo gfx name + amdkmdag driver version (or a re-run of the fixed first_run.ps1 there) to close attribution.

Dacheese-dev and others added 17 commits September 15, 2026 01:38
The lone HIP row in the release matrix pinned ATLAS_TARGET_MODEL to
qwen3.6-27b, so the Windows AMD build validated the 3.6 target only and
this PR's new qwen3.8-27b target was silently uncovered on the only
Windows AMD path Atlas has.

'*' is the same default build-amd.sh uses on Linux, and qwen3.8-27b
reuses qwen3.6-27b's .cu tree through kernel_source, so it compiles one
extra MODEL.toml resolution rather than a second kernel set (Linux
measured 98 unique nvcc invocations for 283 requested).

Worth noting what the Windows row already proves as of this PR's head:
'build windows-x86_64-amd-hip' is GREEN with the vision encoder in the
tree. vision_encoder.cu's only warp intrinsic is __shfl_down_sync x7,
which is precisely what the merged Windows shim
(hip/compat/atlas_hip_win_shims.h) declares -- Windows HIP does not
provide the CUDA mask-argument intrinsics. So the vision port needs no
Windows-specific work to COMPILE. Running it there is a separate matter:
see the row's own note and PR #470.
…P SDK

Windows could not serve at all from a branch cut off main: cuMemGetInfo_v2 in
the HIP shim is a naive passthrough to hipMemGetInfo, which is broken on the
Windows HIP runtime -- it returns hipErrorInvalidValue standalone and free==0
under a live context. Atlas sizes its KV cache and drives its OOM watchdog off
that number, so serve dies with "GPU free memory critically low: 0 MB" partway
through loading, and no --gpu-memory-utilization setting helps because the
.min(actual_free - inference_reserve) clamp forces the budget to 0 regardless.
Qwen3.6 (pure NVFP4, no FP8 requant) fails identically, so this is neither a
quantization nor a Qwen3.8 problem.

Four files, verified on a Framework Desktop (gfx1151, Windows 11, 128 GB):

* libcuda_hip_shim.cpp -- allocation-tracking cuMemGetInfo synthesis from #470,
  plus cuStreamQuery, which main began calling after #470 forked (it is the only
  missing export: 59 vs 58).
* compat/atlas_hip_win_shims.h -- guard __activemask behind HIP_VERSION_MAJOR.
  HIP 7.x declares it natively on Windows, so the shim's unconditional
  definition is a hard "redefinition of '__activemask'" build failure. Not in
  #470, which predates HIP 7.x.
* scripts/strix-windows/first_run.ps1 -- the only Windows entry point, absent
  from main. ATLAS_TARGET_MODEL made overridable rather than hardcoded, and DLL
  staging/preflight matched by pattern instead of literal 6.x names: 7.x renamed
  amdhip64_6 -> amdhip64_7 and amd_comgr_2 -> amd_comgr_3 and added hiprtc*, so
  the literal names stage nothing and fail preflight on a current SDK.
* docs/porting/STRIX_WINDOWS_HIP.md -- the front door the script points at.

With these, Qwen3.8-27B-NVFP4 builds 95 kernels including vision, resolves
(gfx1151, qwen3.8-27b, nvfp4), serves, answers coherently and reads images.

The runtime underneath is a separate matter and the docs say so plainly: ROCm
6.4 is stable but returns degenerate output ~23.5% of the time, and ROCm 7.2
fixes that and halves TTFT but hard-faults the HIP context (status 719) under
sustained load, reproduced 3/3. This commit is what makes Windows work at all;
it is not a claim that the configuration is ready to benchmark.

Co-Authored-By: Claude Opus 5 <[email protected]>
A source build produced a spark.exe that could not run at all. build.rs builds
the HIP shim (cuda.dll, copied to nvcuda.dll) into atlas-kernels' OUT_DIR and
records ATLAS_HIP_RUNTIME_DIR so the release PACKAGING step can bundle it --
but nothing stages it beside spark.exe, and first_run.ps1 staged only the AMD
SDK runtime DLLs. spark links cuda.lib and cudarc dlopens nvcuda.dll, so the
loader finds neither.

The failure mode is why this went unnoticed: the process fail-fasts with
0xC0000409 (STATUS_STACK_BUFFER_OVERRUN) before writing one byte to stdout or
stderr, and logs no Windows Error Reporting entry. `spark.exe --version`
simply prints nothing and exits non-zero, which reads as a corrupt build rather
than a missing DLL. Verified on the Framework Desktop (gfx1151, Windows 11,
HIP SDK 7.2): staging cuda.dll + nvcuda.dll turns that into

    spark 1.0.0-beta-preview   exit 0

Only affects source builds; the packaged release zip already bundles them.

Co-Authored-By: Claude Opus 5 <[email protected]>
first_run.ps1 hardcoded --model-name nvidia/Qwen3.6-27B-NVFP4 in both the serve
invocation and the smoke probe, while ATLAS_MODEL_DIR is a documented override.
Pointing it at Qwen3.8-27B weights therefore served 3.8 under the 3.6 name.

That is not cosmetic. The 3.8 and 3.6 checkpoints have byte-identical
text_config (same model_type qwen3_5, same hidden_size 5120), so kernel-target
resolution hits an exact tie and breaks it on each target's match_names needles,
matched against the HF id / --model-name / model dir. Under the 3.6 name the
tie resolves to kernels/strix-hip/qwen3.6-27b, whose MODEL.toml carries
different MTP depth and sampling defaults -- and because 3.8 legitimately reuses
3.6's kernel tree via kernel_source, nothing fails loudly. It just serves with
the wrong config.

ATLAS_MODEL_NAME now overrides, defaulting from the weights directory, and the
smoke probe and the download hint use the same value.

Co-Authored-By: Claude Opus 5 <[email protected]>
--max-seq-len sizes the inference reserve, not just the context window, so it
belongs alongside ATLAS_GPU_UTIL as a memory knob. ATLAS_MAX_SEQ_LEN now
overrides the hardcoded 65536; 16384 is what serve-amd.sh uses for the certified
Linux run, so both platforms can be driven to the same recipe.

Found while diagnosing the KV-sizing failure below, but it is NOT the fix for
it: dropping 65536 -> 16384 left the buffer arena at 8193 tokens and the
inference reserve at 14.4 GB, unchanged. The arena is sized by
max_prefill_tokens. The actual fix is the FP8-source reclaim in the next commit.

Co-Authored-By: Claude Opus 5 <[email protected]>
Serving unsloth/Qwen3.8-27B-NVFP4 on Windows died at KV sizing with 57.8 GB of
76.9 GB already consumed for a 21.81 GB checkpoint. The loader's own trace shows
the gap exactly -- 'estimated free: 54.9 GB, actual free: 33.1 GB' -- one full
extra copy of the weights.

quantized_from_fp8 reclaims the FP8 source only when both of its downstream
readers are provably off, and the gate is all-or-nothing: the GDN native-FP8
prefill policy (ATLAS_NO_GDN_FP8_PREFILL) and the dense FP8 attention overlay
(ATLAS_DENSE_FP8). serve-amd.sh has defaulted the first to 1 since the reclaim
landed. first_run.ps1 predates it and set neither, so every FP8 source stayed
resident -- 11.56 GB across 401 tensors on this checkpoint.

This is a divergence between the two platform recipes, not a Windows bug: the
same binary reclaims correctly on Linux. Mirrors serve-amd.sh's semantics,
including the ATLAS_NO_GDN_FP8_PREFILL=0 opt-out.

Ruled out first: raising --gpu-memory-utilization to 0.95 does not help. The
allocation is then genuinely attempted and the HIP context hard-faults with
status 719, confirming the 57.8 GB is real rather than a shim accounting
artefact.

Co-Authored-By: Claude Opus 5 <[email protected]>
…ux recipe

The buffer arena is sized by max_prefill_tokens, not max_seq_len. first_run.ps1
never passed the flag, so it inherited the 8192 default: 8193 tokens of arena =
3632.9 MB, plus a 14.4 GB inference reserve derived from it. With the FP8
reclaim in place that still left Qwen3.8-27B 3.6 GB short of a KV pool
(50.7 GB consumed + 14.4 GB reserve = 65.1 GB against a 61.5 GB budget).

serve-amd.sh has run this same silicon at 2048 since the certified MLPerf-edge
submission. Adopting its three numbers wholesale -- 0.86 utilisation,
16384 max-seq-len, 2048 max-prefill-tokens -- makes the Windows recipe the same
recipe as the Linux one, which is the point: the two legs should differ in
toolchain, not in serve configuration. All three stay overridable.

Co-Authored-By: Claude Opus 5 <[email protected]>
A source build could not serve at all: main's kernel audit refuses to start when
dispatch sites resolve to a fallback handle, and the gfx1151 kernel set is much
smaller than gb10's, so many do -- 94 unresolved lookups for qwen3.8-27b
(nvfp4_mmq, w4a16 variants, gated_delta_rule_fla, the turbo prefill paths, the
q4k/q2_0 GEMV variants). 3.8 reuses 3.6's kernel tree verbatim via
kernel_source, so the set is identical to the 92 sites serve-amd.sh documents
for 3.6.

These fallbacks are pre-existing, not something this port introduces: the audit
landed on main after the Strix branch forked, and the certified 3.6 submission
was produced under exactly the same ones. serve-amd.sh has passed
--dangerously-allow-unresolved-kernel-lookups since then; first_run.ps1 never
did, which is the last thing standing between a Windows source build and a
serving process.

ATLAS_NO_KERNEL_FALLBACKS=1 opts out. Closing the gap for real -- compiling the
missing kernels, or declaring them in MODEL.toml [expected_absent] with stated
reasons -- is follow-up work on the kernel tree, and no Strix performance number
should be quoted as final until it is done.

Co-Authored-By: Claude Opus 5 <[email protected]>
The server booted clean, logged 'Server live and ready', and then returned HTTP
500 to every request:

  Prefill chunk layer 0 failed: ssm prefill: out_proj GEMM failed:
  Kernel lookup w4a16_fp8_ldmab::fp8_fp8_gemm_ldmab:
  Module 'w4a16_fp8_ldmab' not loaded

fp8_fp8_gemm_ldmab is the GDN-projection prefill fast path. It is default-ON on
main and NVIDIA-only -- kernels/gb10/common/w4a16_fp8_ldmab.cu is built from
mma.sync...e4m3.e4m3 plus ldmatrix.x4, neither of which has an RDNA3.5
equivalent -- so the module is absent from the strix kernel set. Unlike the
other missing lookups this one is not a soft fallback covered by
--dangerously-allow-unresolved-kernel-lookups; it is issued lazily, after the
boot audit has sealed, and fails hard on the first prefill.

serve-amd.sh has exported ATLAS_FP8_LDMAB=0 since the port and documents exactly
this failure. first_run.ps1 never picked it up. Fourth and last divergence
between the two platform recipes found by driving this leg end to end.

Co-Authored-By: Claude Opus 5 <[email protected]>
…n run

Everything the doc previously described was produced from a packaged binary.
Driving first_run.ps1 from a clean source checkout surfaced six separate faults
between cargo build and a server that answers a request, five of them drift from
serve-amd.sh rather than Windows bugs. Tabulates each with its cause, and records
the 2026-08-25 validation: green builds on both HIP SDKs, the qwen3.8-27b
tie-break resolving with both targets embedded, MTP active, and the
quick-speed-bench baseline.

Co-Authored-By: Claude Opus 5 <[email protected]>
bfcl-eval pins faiss-cpu==1.11.0, which has no Python 3.14 wheel, and 3.14.7 is
the only interpreter on this box. The leg fails during venv provisioning and
never reaches the model, so it is an environment prerequisite rather than a port
defect. Says plainly not to relax the pin: the pinned set is what every recorded
BFCL score was produced against.

Also records the two adjacent traps found driving this remotely -- scoop shims
that cannot spawn their target under non-interactive SSH, and Win32_Process
children not inheriting HOME.

Co-Authored-By: Claude Opus 5 <[email protected]>
…me bug

Installing Python 3.12 and pointing ATLAS_PYTHON at it unblocked the leg, so the
prerequisite note is now a resolved recipe rather than a blocker. The run itself
completed all 70 samples and emitted zero tool calls, identically to Linux --
a shared-port correctness bug, not a Windows one, and not a score. Scoring then
failed on a machine Application Control policy blocking tiktoken's native DLL,
which was deliberately not worked around.

Co-Authored-By: Claude Opus 5 <[email protected]>
Cross-references the three-way comparison showing the pre-restoration Avarok
build fails identically, so the Windows leg's zero-tool-call result is inherited
rather than introduced.

Co-Authored-By: Claude Opus 5 <[email protected]>
…he crash

Mirrors the validated port/qwen3.8-strix-linux source over this branch
(sync-windows-mirror.sh): the dense_gemm_tc quarantine + pipelined BF16 FFN
prefill fix (the serve-path correctness fix — the gfx1151 WMMA port of
dense_gemm_tc leaves ~half its output tile unwritten and ran ~1000x slow in
situ, which is the root cause of the zero-tool-calls leg both platforms
shared), the per-row FP8 -> BF16 preservation module, the native-HIP GDN
BF16 prefill route, the BC=32 paged prefill validation, the generic
template_owns_tool_definitions lever, and the authoritative unsloth
MODEL.toml. The Windows-only hip shims and first_run.ps1 stay Windows-owned;
the divergent template_owns_tool_prompt key (zero readers, grep-verified) is
dropped with the kristianpaul hf_id it shipped with.

Built ONCE from the mirrored tree:
target\x86_64-pc-windows-msvc\release\spark.exe sha256
ba99809d6d9bb8ed534cf64990abfcd4d42fece91f3e4f73a4321a9da152147d.
Device Guard did not block it. Parity smoke passes (recall + a correct
get_current_weather tool call). Windows serve needs --no-fast-load and a
lower utilization than Linux (the 76.9 GB ROCm pool with 43.8 GB preservation
pre-KV: 0.88 sizes a 22 GB KV that hits the budget exactly; 0.70-0.74 works).

GATE STATUS — the evaluation suite does NOT pass yet, by bisection:
* BFCL-70 on the DESTRUCTIVE requant path (util 0.78): COMPLETED, overall
  82.86 / normalized 78.75 — live 85.71 and hallucination 56.25 identical to
  the Linux preservation run (run record
  C:\Users\azeez\.atlas\runs\bfcl-subset\run-1788342153742063300.json). This
  also proves the original 27% disaster was the broken tc serve, not the
  requant itself.
* The PRESERVATION BF16 decode paths crash under sustained load: three
  crashes across three configurations (K2/preservation 52-min hang then
  device loss; K0/preservation launch failure; K0/destructive launch failure
  at ~sample 750 of ST-995). Kernel microtests + the GEMM oracle all PASS on
  Windows HIP, so the suspect set is the uncovered decode-path kernels
  (dense_gemv_bf16 M=1, GDN decode, paged decode) or a Windows ROCm
  shared-pool durability issue. ST-995 has no valid Windows run; no Windows
  accuracy number is claimed. Full crash logs:
  C:\Users\azeez\q38-win-bfcl70*.log, q38-win-st995.log.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The reproducible record of the Windows gate attempts and the crash
bisection:

* win_smoke.ps1 — the parity smoke (recall + one relevant tool control) on
  the frozen recipe mapped for Windows (--no-fast-load, util 0.70,
  --num-drafts 0). PASSES on the mirrored source.
* win_bfcl70.ps1 / win_bfcl70b.ps1 / win_bfcl70c.ps1 — the BFCL-70 gate at
  three configurations (preservation K2 / preservation K0 / destructive K0),
  which bisected the serve crash to the preservation BF16 decode paths; the
  destructive run completed 82.86/78.75.
* win_st995.ps1 — the pinned ST-995 attempt (scheduled-task launcher with
  HOME/ATLAS_HOME set; crashed at ~sample 750, no valid Windows run).
* win_microtests.ps1 / win_oracle.ps1 / win_oracle_run.ps1 — the kernel
  microtest sweep (gdn_split4, paged/contiguous attention, w8a16, w4a16
  parity: all PASS) and the dense_gemm_bf16 oracle on Windows HIP.
* win_meminfo.ps1 / win_tdr_check.ps1 — host-memory and TDR/driver-event
  diagnostics for the durability investigation.
* win_bench_fg.ps1 — the foreground benchmark wrapper (PowerShell 5.1 turns
  native stderr progress into a terminating error under
  ErrorActionPreference=Stop; Start-Process + file redirection avoids it).
* first_run.ps1 — the entry-point updates from the earlier session.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dense_gemv_bf16_oracle (M=1 at all eight Qwen3.8 decode shapes vs an f32 CPU
reference) PASSES on Windows HIP: mean_rel <= 1.2e-5, cos >= 0.99999999 -
identical to the Linux result. The Windows crash suspect set shrinks to the
uncovered decode kernels: mamba2_ssm_decode (GDN decode recurrence),
paged_decode_attn, and the SSM snapshot/rollback ring.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Maintainer clarification, added to the agent context files (AGENTS.md,
CLAUDE.md, GEMINI.md) so every assistant reads the same rule: the MLPerf
edge-agentic ST accuracy leg is DEFINED as the BFCL golden draw (non_live 62
/ live 10 / hallucination 10, floor 25, n=995, seed 42, temp 0, no
overrides), and Atlas's own `spark benchmark run bfcl-subset` with no
overrides IS that leg - there is no separate MLPerf ST gate, and the
external harness is an alternative runner, not a different gate. Records the
Strix Qwen3.8-unsloth baseline (84.22/83.68,
run-1788366618469517340.json) and the 12/23/46 not-MLPerf warning.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
AzeezIsh and others added 10 commits September 15, 2026 02:25
Add w8a16_gemm_n_m128, a 128x128 AMD-WMMA block-scaled FP8 prefill kernel
that reads the checkpoint's native B[N,K] (k-contiguous) weight and FP32
block_scale[N/128,K/128] directly. The k-contiguous load lets each thread
fetch 16 consecutive k per n and write a contiguous 16-bf16 run into
smem_B[n][k] via two uint4 stores — eliminating the in-kernel transpose and
the strided ~16-way bank-conflicting scalar stores the transposed
w8a16_gemm_t_m128 pays.

Route every large-M FP8 prefill GEMM through it on gfx1151, preferring it
over the transposed arm: SSM qkvz + out_proj and attention q/k/v + o_proj.
All fall back to w8a16_gemm_t_m128 when the kernel is absent.

Measured on Windows Strix Halo (gfx1151/ROCm10, nvidia/Qwen3.8-27B-NVFP4,
~1950-token nonce-cold prompts, temp=0, max_tokens=1): ~199-203 tok/s
cold prefill vs ~182 tok/s for the transposed bit-math kernel (~+10%),
numerically correct output.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
open(path) used the locale default, which is cp1252 on Windows — the staged
scorer crashed on responses.jsonl (UnicodeDecodeError at byte 0x8f) after a
fully clean 995-sample leg, failing the run record at the last step.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The comments claimed gfx1151 wavefronts are 64-wide. They are not: hipcc is
invoked with no -mwavefrontsize64 (wave32 default on gfx10+), and the tree's
_w32 WMMA builtins only compile in wave32 mode. The widen exists because
HIP's _sync mask parameter and __activemask() return are `unsigned long
long` API-wide — an API-width fix, not a wavefront-size fix.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…+ recipe

First measured Windows bfcl-subset record for nvidia/Qwen3.8-27B-NVFP4 on
gfx1151: the pinned golden draw (n=995, seed 42, temp 0, no overrides),
run-1789300938267487600, fp8d tree 8eedc21, ROCm 10.0.0, spark.exe sha256
367AA4E4 — full fingerprint in the entry note. Floors at measured-minus-0.4.
Ports the unsloth/Linux baseline entry from 5cf6bfb alongside it; the two
entries are explicitly not an A/B (checkpoint, OS, ROCm, recipe all differ).

Also: the verbatim serve recipe as scripts/strix-windows/
win_serve_qwen38_nvfp4.ps1, and a dated supersede note on the tool-path
!!!!!! section of QWEN38_STRIX_PORT.md — real tool calls were scored on
this tree, attribution between the changed variables left open.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Every unresolved lookup on (gfx1151, qwen3.8-27b, nvfp4) is a try_kernel
optional arm gated on handle != 0 at dispatch — alternative-quant FFN arms
(q4k/q2_0/w4a4/w8a16 on an NVFP4 checkpoint), env-gated paths
(ATLAS_FFN_MMQ / ATLAS_INT8_PREFILL / ATLAS_SSM_H_FP16 / turboKV, all off
in the recipe), gb10-only register-resident wy twins, K>4 verify arms
unreachable at num-drafts 3, and the TurboQuant prefill family. Each entry
names its probe site and the resolved fallback.

Three arms are marked UNPORTED rather than merely unselected — the
nvfp4_mmq W4A4 MMQ prefill family (default-on on gb10; w4a16 t_m128
serves here) and the gdn_verify_fused_* chain (report lever #5). Both are
tracked perf candidates, not hidden.

Verified on winbox ROCm 10.0.0, spark.exe 256F9A62: boot WITHOUT
--dangerously-allow-unresolved-kernel-lookups now passes — zero
unresolved warnings, '87 kernel(s) declared expected-absent', zero
errors, decode 17.53 tok/s median (n=3, same fingerprint) unchanged.
The serve recipe drops the flag and comments why; re-adding it would
mute exactly the signal the gate exists for.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…flight

Three changes driven by a 2026-09-14 report: the old script reproducibly
bugchecked a second Strix-class box (0x119 VIDEO_SCHEDULER_INTERNAL_ERROR,
GPU page fault under dxgmms2/amdkmdag) on first inference.

1. Serve profile -> the fp8d recipe (fp8 GDN weights+decode, global-GDN,
   ssm tail protect, drafts=3, ssm-cache-slots=64) — the fingerprinted
   config behind the 2026-09-13 ST-995 record — replacing the preservation
   profile whose bf16-GDN kernel path is a different arm set and a live
   suspect. max-seq 4096 / util 0.70 stay (footprint knobs, env-overridable);
   --disable-thinking stays so the smoke fits 64 tokens.
2. Check-Gpu wrong-arch is now a hard FAIL, not a Warn — a wrong-arch or
   faulting compute launch on WDDM can take the whole OS down; a first-run
   script must never bluescreen someone. ATLAS_SKIP_GPU_CHECK=1 overrides.
3. Drop --dangerously-allow-unresolved-kernel-lookups: all 87 probes are
   declared expected_absent now, and a first-run script must not ship the
   escape hatch that would hide a genuinely new missing kernel.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
f52757f/edd5cc20b replays landed conflict markers inside
libcuda_hip_shim.cpp, trait_decode_batched.rs, embed_chunk.rs,
forward_layers.rs, meta.rs. Resolved as: main's newer paths kept
(ssm_fp4_proj DP4A arm, ngram embed, HYPER_RMS hook, dflash bind,
cuStreamIsCapturing), with the Windows-only additions folded back
(traced graph capture, K4/sync/timing instrumentation).
The Windows evidence (ST-995 x2, agentic x30) ran the nvidia checkpoint;
make the default match what was validated. ATLAS_MODEL_NAME remains the
override.
@AzeezIsh
AzeezIsh force-pushed the port/qwen3.8-windows branch from 5b2dd9f to fff1418 Compare September 15, 2026 06:29
@AzeezIsh
AzeezIsh changed the base branch from port/qwen3.8-strix-linux to main September 15, 2026 06:29
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Rebased onto main (post-#8 merge) — head fff141850

The Linux PR merged, so this branch is now rebased onto main and retargeted. 33 commits ahead, MERGEABLE. Conflicts resolved as:

  • "Mirror frozen Linux source" commits — main already carries newer versions of those files; took main's (e.g. serve-amd.sh with unsloth-gated FP8-dequant, formatted oracles, gdn_decode_oracle entry).
  • w8a16_gemv_batch4.cu type conflict — kept main's real Strix-ported scalar kernel over this branch's older gb10 symlink stopgap.
  • load_fns.rs — true merge: main's evolved loader (ngram deferral, F16→BF16, managed-UVM fallback) for the non-Windows path + stream_shard_windows kept for cfg(windows), upgraded with the deferred param + ngram branch + matching max_len filter.
  • BENCH.toml — gate schema rejects duplicate checkpoints per hardware (declared twice bail), so the single nvidia entry stays main's Linux record with the Windows 11 observation folded into its note (83.32/78.70 + clean-binary 83.12/78.45, agentic 30/30, recipe + fingerprints, marked non-comparable/unattributed).
  • Committed-marker cleanup (e867b24e8): 5 files where the rebase left <<<<<<< markers — resolved keeping main's newer paths (ssm_fp4_proj DP4A arm, ngram embed, HYPER_RMS, dflash bind, cuStreamIsCapturing) with the Windows-only additions folded back (traced graph capture, K4/sync/timing instrumentation).
  • New on top (fff141850): first_run.ps1/serve-amd.ps1 default checkpoint → nvidia/Qwen3.8-27B-NVFP4, matching what the Windows evidence actually ran.

Checks post-rebase: cargo fmt --check clean, typos clean, SPDX headers verified on touched files, cargo clippy -p spark-runtime -p spark-model -p atlas-kernels clean (workspace --tests fails only on the pre-existing macOS IoUringBackend cfg-gate — Linux CI will cover it).

Open items for merge decision: CI/serve-matrix green on this head; the 0x119 bugcheck attribution (needs the reporter's gfx arch + amdkmdag version, or a re-run of the fixed first_run.ps1 on that box); human sign-off.

AzeezIsh and others added 3 commits September 15, 2026 02:32
…union

gpu.rs (470+57), qwen3_ssm/init.rs (484+23), ssm_forward.rs (477+42),
trait_prefill_proj.rs (439+119) — each side stayed under on its own; the
rebased union tips them over. Same pattern as the #8 merge entries
directly above: allow-list now, split post-merge.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Two CI-only breakages surfaced on the rebased branch:

- cargo test / llvm-cov / benchmark gate: the graph-capture KV-clear path
  (spark-runtime::cuda_backend::gpu_impl_graph) is the first workspace
  caller of the driver-API cuMemsetD2D8Async, and the hand-maintained
  no-GPU libcuda stub only had the D8/D32 flat variants — undefined
  symbol at link time on GPU-less runners. Add the pitched variant with
  the same fail-fast return-100 convention.
- Build mdBook + rustdoc: an unquoted `B[N,K]` in init_fp8.rs parsed as
  an intra-doc link (`no item named N,K`). Escape the brackets; the
  backticked and //-comment occurrences were never link candidates.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The AMD bf16x2 dot2 path stages `s_lut2` block-wide in w4a16_gemv_sw with
a __syncthreads() placed BEFORE `if (n >= N) return` — every thread
reaches it, so it is not the divergent barrier the structural test was
written to forbid (a sync after the warp-uniform early return). The
blanket contains() check predates the AMD staging and now fails on a
safe pattern. Assert the real invariant instead: no __syncthreads() in
the body region after `if (n >= N) return`. The proven-by comment still
holds — a post-return barrier or `s_lut[8][16]` keeps this red.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

CI status after rebase fixes — head bbd21701a

All checks that can gate on code are now green:

Check Result
cargo test --workspace ✅ 788 pass (was: link fail → 1 test fail, both fixed)
cargo llvm-cov ✅
cargo clippy --tests ✅
cargo fmt / typos / SPDX / cargo deny ✅
≤500 LoC cap ✅ (4 merge-union files allow-listed, same pattern as #8)
Build mdBook + rustdoc ✅ (escaped B\[N,K] intra-doc link)
nvcc -> PTX (all gb10 targets) ✅ 10m29s — incl. modified w4a16_gemv.cu
release matrix linux-x86_64 + linux-aarch64 ✅
kernel shadow structure / GDN PINS / misc guards ✅

Fixes pushed on top of the rebase:

  • ec3d1c867 — LoC allow-list: gpu.rs 470+57, qwen3_ssm/init.rs 484+23, ssm_forward.rs 477+42, trait_prefill_proj.rs 439+119 — each side under on its own, union over; same shape as the Qwen3.8-27B on Strix Halo (gfx1151) — Linux leg #8 entries.
  • c43362757 — ci_gpu_stubs.sh stubs cuMemsetD2D8Async (the graph-capture KV-clear path is the first workspace caller; no-GPU runners link a hand-maintained fail-fast libcuda) + escaped a broken B[N,K] doc link.
  • bbd21701a — gemv_sw structural test now asserts the real invariant: no __syncthreads() after the warp-uniform if (n >= N) return (divergent UB). The AMD s_lut2 block staging syncs before the return — every thread reaches it — which is safe and was never the UB the test documented.

Two reds that are not code:

Still open for merge decision: the friend's 0x119 attribution (gfx arch + amdkmdag version from that box, or a re-run of the fixed first_run.ps1), and human sign-off.

AzeezIsh and others added 3 commits September 15, 2026 09:44
…name

fff1418 switched ATLAS_MODEL_NAME to nvidia/Qwen3.8-27B-NVFP4 but left
ATLAS_MODEL_DIR pointing at models\Qwen3.8-27B-NVFP4 (the unsloth snapshot),
so serve-amd.ps1 loaded the wrong checkpoint while reporting the nvidia id.

The unsloth snapshot stores GDN projections as per-row FP8, which misses the
block-scaled fp8_preservation arm and lands in the NVFP4 arm where the
ATLAS_GDN_FP8_DECODE recipe then also installs the rowwise copies — NVFP4 +
transposed NVFP4 + FP8 prefill + rowwise all resident (~57 GB pre-KV vs
~39.7 GB on the nvidia modelopt snapshot) and the KV budget fails.

Deriving the dir default from the checkpoint leaf keeps name and snapshot
consistent for both the default and the ATLAS_MODEL_NAME override case.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
On the ~63 GB gfx1151 pool the nvidia checkpoint needs ~39.7 GB pre-KV plus
the ~14.6 GB inference reserve, so --gpu-memory-utilization must clear ~0.86
to leave any KV at all; the 0.70 default produced "No memory left for KV
cache" out of the box. 0.95 is the value in the validated fp8d recipe
(win_serve_qwen38_nvfp4.ps1) that produced the ST-995/agentic evidence.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The leaf split in 208f6ba dropped the org prefix — 'nvidia/Qwen3.8-27B-NVFP4'
derived models\Qwen3.8-27B-NVFP4, the unsloth snapshot dir this fix exists to
avoid. The on-disk convention is org-dash-repo: 'nvidia-Qwen3.8-27B-NVFP4'.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions github-actions Bot removed the needs-rebase Conflicts with main — its green checks are NOT real (GitHub skips merge-commit workflows) label Sep 15, 2026
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Serve regression resolved — verified end-to-end on gfx1151 (head 3c83a0e)

Root cause — not a code regression. fff141850 switched ATLAS_MODEL_NAME
to nvidia/Qwen3.8-27B-NVFP4 but left ATLAS_MODEL_DIR defaulting to
models\Qwen3.8-27B-NVFP4 (the unsloth snapshot). The serve loaded unsloth
(compressed-tensors, 303 ignored modules, per-row FP8 GDN weights) while
reporting the nvidia id. Per-row scales miss the block-scaled
fp8_preservation arm, landing in the NVFP4 arm where the
ATLAS_GDN_FP8_DECODE recipe additionally installs rowwise copies —
NVFP4 + transposed NVFP4 + FP8-prefill + rowwise all resident → 57.0 GB
pre-KV, no room for KV even at util=1.0.

The nvidia modelopt snapshot (per-tensor-scaled FP8) takes the single-copy
arm and needs ~37–40 GB.

Fixes pushed

  • 208f6baa + 3c83a0e4 — ATLAS_MODEL_DIR default now derives from the
    checkpoint id as models\<org>-<repo> (matches hf download --local-dir
    convention; name and dir can't drift apart).
  • 1d72e8e5 — ATLAS_GPU_UTIL default raised to 0.95, the fingerprinted
    fp8d recipe value. On the ~63 GB gfx1151 pool the nvidia checkpoint needs
    37.2 GB pre-KV + 14.3 GB reserve, so ≥0.93 is required for KV at all.
  • Doc hf download line updated to the nvidia- snapshot dir.

Verified serve (.\serve-amd.ps1 external-user flow, no env overrides):

Model path: C:\Users\azeez\models\nvidia-Qwen3.8-27B-NVFP4  (correct dir)
Quantization: modelopt MIXED_PRECISION, 2 ignored          (modelopt)
SSM[..] native FP8 GDN: block-scaled FP8 (prefill+decode w8a16)  (single copy)
Atlas-own 37.2 GB pre-KV → 8.3 GB KV, 135,360 max KV tokens
Server live at 127.0.0.1:8081 in ~61 s
SMOKE OK  finish=length  tokens=63   (built-in probe)
manual completion: finish=stop, coherent

Log: final-serve3.log on the validation box.

Note for reviewers: the unsloth per-row-FP8 snapshot legitimately needs
57 GB resident on this path — it fits only on pools ≥72 GB. That is a
checkpoint property, not a merge regression (unsloth serves from Sept 10–11
on the pre-rebase binary showed 47–52 GB on a 76.9 GB pool). The validated
Windows target is the nvidia checkpoint.

AzeezIsh and others added 2 commits September 15, 2026 12:28
Array-splatting @Args turned '-NoSmokeTest' into a positional string that
first_run.ps1 could not bind ("positional parameter cannot be found that
accepts argument '-'"). Give both wrappers a real param() block: serve-amd.ps1
takes positional -ModelDir (weights snapshot path -> ATLAS_MODEL_DIR, with an
explicit not-found error instead of silently ignoring a bad path) plus
-NoSmokeTest; build-amd.ps1 takes -NoSmokeTest for symmetry.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…8-27B-NVFP4

The quick-start section linked the Windows branch but only documented the
Linux script pair. Add the gfx1151 Windows path: build-amd.ps1/serve-amd.ps1
(PowerShell, not Git Bash), the ATLAS_BIN prebuilt-zip shortcut with the
DLL-beside-exe requirement, the fp8d serve recipe, and the fingerprinted
ST-995 record (run-1789300938267487600 / run-1789375300874322000). Also
corrects the leg label — the Windows path is native HIP over ROCm 10
TheRock, not DirectX 12.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AzeezIsh
AzeezIsh merged commit f2ec96d into main Sep 16, 2026
18 of 20 checks passed
AzeezIsh added a commit that referenced this pull request Sep 19, 2026
…rote

PR #9 (Strix Halo Windows leg, f2ec96d) replaced kernels/gb10/common/
dense_gemv_bf16.cu with the gfx1151 "v2" kernel while its own header says
"the gb10 symlink is replaced by this copy so the certified NVIDIA target
is untouched". The gb10 blob changed (805c07e -> 779f60c); the symlink
that was replaced was strix-hip's, pointing AT gb10.

v2 is not bit-identical to v1 on gb10, contrary to its comment: v1 splits
each output's K range over 64 threads (BLOCK_SIZE 256 / N_PER_BLOCK 4,
stride 64, two-warp shuffle + smem add); v2 over 32 (stride 32, one warp).
Each thread therefore accumulates a different subset of products in FP32,
and the final BF16 rounding differs at near-ties. Flash-Next dispatches
this kernel on its BF16 lm_head and on all 36 GDN projections
(qwen3_ssm/init.rs, impl_a1.rs, ops/qwen4exp.rs), and several kernels
document a "bit-identical to dense_gemv_bf16 at M=1" contract
(qwen3_attention/decode/attention_forward.rs:762, multi_seq/qkv.rs:159).

Observed: nvidia/Qwen3.8-Flash-Next-NVFP4 ST-995 (golden draw, n=995,
temp 0, serial) on the same serve profile and box: 83.52/82.45 at
45f5b35+tiebreak (run-1789591710115920743) vs 83.42/81.40 at 1cec998,
whose only engine delta is the merge of main incl. #9
(run-1789856554862860168); twelve subsets moved by 1-2 samples each in
both directions, the signature of near-tie flips, not of a category
regression. Restoring v1 on gb10 only; strix-hip keeps its v2 copy.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
andrew-vogulkin added a commit to andrew-vogulkin/atlas that referenced this pull request Sep 29, 2026
…-absent

The gfx1151 port (Atlas-Inf#9/Atlas-Inf#33) added a try_kernel probe for w4a16_gemm_t_m128_k16
in the shared dense_ffn constructor. 6f52a7d declared it [expected_absent]
for gb10/qwen3.8-27b only; gb10/qwen3.6-27b, which qwen3.8-27b borrows its
kernel tree from, was left out, so the kernel-resolution audit refuses to
boot unsloth/Qwen3.6-27B-NVFP4 on GB10:

    1 unresolved kernel lookup(s) for (qwen3.6-27b, sm_121, nvfp4)
      1. w4a16::w4a16_gemm_t_m128_k16  at crates/spark-model/src/layers/dense_ffn.rs:450

That checkpoint is the required subject of the video-fidelity gate, so no
video-fidelity record can be produced on main today. Same wording as the
qwen3.8-27b entry; the site is handle!=0 gated and gb10 dispatches the
compiled w4a16_gemm_t_m128 / w4a16_gemm arms.

Found by the Atlas-Inf#91 gate campaign on GB10 (spark), 2026-09-29.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
(cherry picked from commit 5668e8b)
AzeezIsh added a commit that referenced this pull request Nov 4, 2026
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.

4 participants