Skip to content

strix/scale: unblock SCALE 1.8.0 out-of-the-box build and boot - #436

Merged
AzeezIsh merged 1 commit into
mainfrom
fix/strix-scale18-ootb
Dec 4, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
fix/strix-scale18-ootb

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Unblocks building and serving ATLAS_TARGET_HW=strix (SCALE 1.8.0) out of the box on AMD Strix Halo (gfx1151), tested against nvidia/Qwen3.8-27B-NVFP4:

  1. Missing atlas_pdl.cuh symlink: Added kernels/strix/common/atlas_pdl.cuh -> ../../gb10/common/atlas_pdl.cuh, which previously failed 22 strix kernels at compile time (__CUDA_ARCH__=890 under SCALE 1.8.0 compiles it cleanly as a no-op).
  2. FastSafetensorsLoader O_DIRECT + cuMemHostAlloc EFAULT fallback: SCALE 1.8.0's shoulder HSA pinned host memory is rejected by Linux O_DIRECT pread() with EFAULT (whereas posix_memalign succeeds with O_DIRECT). Added a 1-block PinnedUploader::supports_direct_io probe against the first shard; on EFAULT it logs once and falls back to ShardReaders (still O_DIRECT + pipelined, zero page-cache pollution, no ATLAS_FAST_LOAD=0 needed). NVIDIA and strix-hip are unaffected.
  3. Toolchain auto-discovery & script defaults:
    • find_scale_dir(), build-amd.sh, and serve-amd.sh sort discovered scale*-Linux installs newest-first when SCALE_HOME is unset.
    • serve-amd.sh defaults ATLAS_FFN_SMALLM=1 on strix only (strix-hip unchanged at 0), avoiding the heavy VGPR spill in SCALE's CUDA m128 path on short prompts.
    • serve-amd.sh exposes KV_DTYPE (default bf16) instead of hardcoding --kv-cache-dtype bf16.

Verification

  • cargo fmt --all -- --check, cargo clippy -p spark-runtime -p atlas-kernels --tests -- -D warnings, RUSTDOCFLAGS='-D warnings' cargo doc --no-deps, kernel_shadow_detector, and 31/31 fast_weights unit tests (including new direct_io_probe_accepts_valid_buffer_and_rejects_efault).
  • Fresh-checkout E2E build + serve verification of b283c8e44 on framework (gfx1151, SCALE 1.8.0, nvidia/Qwen3.8-27B-NVFP4) running now — receipts will be posted once complete.

- Symlink kernels/strix/common/atlas_pdl.cuh -> ../../gb10/common/atlas_pdl.cuh
  (missing on main; broke 22 strix kernels at compile time; __CUDA_ARCH__=890
  under SCALE 1.8.0 compiles it as a no-op).
- Probe O_DIRECT pread on PinnedUploader slot 0 against the first shard in
  FastSafetensorsLoader; on EFAULT (SCALE 1.8.0 shoulder HSA cuMemHostAlloc
  memory is rejected by kernel O_DIRECT get_user_pages while posix_memalign
  succeeds), warn once and fall back to ShardReaders (still O_DIRECT +
  pipelined, no page-cache pollution, no ATLAS_FAST_LOAD=0 required).
- Prefer newest installed SCALE toolchain in find_scale_dir(), build-amd.sh,
  and serve-amd.sh when SCALE_HOME is unset.
- Default ATLAS_FFN_SMALLM=1 on strix (SCALE) in serve-amd.sh (leaves
  strix-hip untouched at 0) and expose KV_DTYPE (default bf16) so
  KV_DTYPE=fp8 works without duplicate --kv-cache-dtype flags.
@AzeezIsh

AzeezIsh commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

E2E Verification Receipt (b283c8e44, fresh checkout on framework / Radeon 8060S gfx1151, SCALE 1.8.0)

Built and served with zero workaround env vars (unset SCALE_HOME ATLAS_FAST_LOAD ATLAS_FFN_SMALLM KV_DTYPE):

  • Auto-discovery: build-amd.sh selected /home/azeez/scale180/scale-1.8.0-Linux/targets/gfx1151/bin/nvcc (96/96 kernels compiled, BUILD_RC=0).
  • Fast weight loader fallback: O_DIRECT probe detected EFAULT on SCALE 1.8.0's cuMemHostAlloc staging buffer, warned once, and loaded all 2,194 tensors (20.42 GB) in 4.2s via ShardReaders (O_DIRECT + posix_memalign), healthy in 34s.
  • E2E inference (nvidia/Qwen3.8-27B-NVFP4, default MTP K=4, greedy temp 0):
    • Math (34 tok): TTFT=10.08s, 17.37 tok/s, exact (432)
    • Code (41 tok, Lomuto quicksort): TTFT=7.85s, 16.75 tok/s, coherent Python + complexity

@AzeezIsh

AzeezIsh commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Verified on top of current main (integration branch = main 585c8fa + #436/#437/#438, merged clean), DevLab strix-hip, Qwen3.8-27B-NVFP4, C=1 64K:

  • native HIP path byte-identical to main: greedy hashes match for MTP (a6bc3b8b … 73c09d1b) and DFlash2 (a6bc3b8b … 1baa65e7)
  • speed within noise: MTP decode 22.5 vs 22.3, prefill 458/466/435 vs 452/460/429; DFlash2 23.2 vs 23.6, 443/448/419 vs 445/451/423
  • the two kernels gated off on atlas_scale were already unresolved on strix-hip (listed in its MODEL.toml), so no HIP dispatch change
    SCALE-path receipts are the fresh-checkout runs on framework posted above. Red checks are the repo-wide three (env budget, bench gate, cargo deny).

@AzeezIsh
AzeezIsh merged commit 1415798 into main Dec 4, 2026
24 of 27 checks passed
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.

1 participant