mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #409] [CLOSED] aarch64 / NVIDIA DGX Spark (GB10): build, run and set up with unified memory #2627
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#2627
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/409
Author: @eelgaev
Created: 10/1/2026
Status: ❌ Closed
Base:
main← Head:arm-gb10-port📝 Commits (1)
44df8fdSupport aarch64 and NVIDIA DGX Spark (GB10, unified memory)📊 Changes
21 files changed (+535 additions, -50 deletions)
View changed files
📝
CMakeLists.txt(+39 -9)📝
README.md(+4 -0)➕
docs/DGX_SPARK.md(+99 -0)📝
include/strata/core/expert_cache.hpp(+6 -0)📝
include/strata/hip_compat/cuda_runtime.h(+1 -0)📝
include/strata/kernels/cpu/expert_layout.hpp(+9 -0)➕
include/strata/platform/cpu_relax.hpp(+20 -0)📝
setup.py(+89 -13)📝
src/core/expert_cache.cpp(+39 -0)📝
src/core/expert_source.cpp(+1 -1)📝
src/core/graph.cpp(+2 -2)📝
src/core/session.cpp(+3 -7)📝
src/core/verify.cpp(+5 -5)📝
src/kernels/cpu/expert_layout.cpp(+24 -1)📝
src/kernels/cpu/native_expert.cpp(+4 -0)📝
src/kernels/cpu/pool.cpp(+7 -7)➕
src/kernels/cpu/portable.cpp(+159 -0)📝
src/program/generate.cpp(+6 -4)📝
tools/test_setup_golden.py(+1 -0)📝
tools/test_setup_unsloth.py(+15 -1)...and 1 more files
📄 Description
aarch64 / NVIDIA DGX Spark (GB10): build, run and set up with unified memory
This PR makes Strata build and run on aarch64, and
./setup.shwork end to end on an NVIDIA DGX Spark. It is experimental and community-tested, in the same spirit as the AMD HIP and sm_70 builds: one DGX Spark, Qwen3.8-Flash-Next IQ2_XS installed by setup. x86 builds are unchanged.Speed (IQ2_XS, setup's own
run-iq2_xs.sh: 128K context,--kv int8)All 24,576 experts fit in the GPU's expert cache (33.0 GiB), so the CPU computes none.
llama-benchy 0.4.0, 3 runs after a warm-up,
--no-cache, one request at a time, 128 tokens decoded per request. Prefill and decode are from the server log (strata serve: prompt ...). benchy'sppcolumn cannot time Strata's server, because the first stream chunk is sent before the prompt is read; details are indocs/DGX_SPARK.md.What changes
The change splits naturally into three parts. Happy to send them as separate PRs if you prefer.
1. Build and engine on aarch64
src/kernels/cpu/portable.cppreplaces the AVX-only kernel files on non-x86 (CMake chooses byCMAKE_SYSTEM_PROCESSOR). It contains the activation quantizer (expert.cpp's scalar loop) and the BF16 router dot (NEON). The AVX multi-token kernels report themselves unsupported, so native experts use ggml-cpu's NEONvec_dot.q2_own_kernels()). x86 keepsq2_rows_any.include/strata/platform/cpu_relax.hpp:_mm_pause/_mm_sfenceon x86 (as before),yield/dmb oshston aarch64.-ffp-contract=offfor C/C++ on non-x86 GCC/Clang, as an x86 build without-mfmaeffectively has, so host roundings match x86 and ggml. (quantize_act_parity's Q8_K case failed without it.)GGML_CPU_ARM_ARCHturnsGGML_NATIVEoff: gcc's-mcpu=nativefinds no features on GB10's Cortex-X925/A725, which leaves ggml-cpu without dotprod/i8mm.2. Expert cache sizing on unified memory
device_free_bytes()is used by both the cache sizing andExpertCache::open's check. When the driver reports that the GPU shares host memory (cudaDevAttrIntegrated), it countsMemAvailableless 6 GiB (STRATA_UMA_HEADROOM_GIB) as free.cudaMemGetInfocounts only free RAM, and with--mmap-expertsthe page cache is mostly the GGUF's own pages. NVIDIA's DGX Spark Porting Guide (§5.5) recommends the same; swap is not counted.hip_compat:cudaDevAttrIntegrated→hipDeviceAttributeIntegrated.3. setup
CU_DEVICE_ATTRIBUTE_INTEGRATEDvia libcuda, matched to nvidia-smi by PCI address;memory.total [N/A]only as a fallback) and gets the system's RAM as its memory.GGML_CPU_ARM_ARCHfrom/proc/cpuinfo(engine and strata-vision); the CUDA repository key comes fromsbsa;cpu_info()handles the absence of an x86flagsline; no AVX2 requirement.--mmap-experts(an expert arena in RAM would be a second copy of the cache in the same memory) and no KV streaming.Plus
docs/DGX_SPARK.mdand a README pointer next to AMD HIP.Tested on a DGX Spark
./setup.sh --model IQ2_XS --gguf-dir ... --vision no --yes: detects the GB10, compiles, packs, writes the start script.--expert-cache 2048the CPU computed ~22 of ~29 experts per layer, Q2_0 rows included. Output was identical, token for token, to the all-GPU run (18.8 vs 81.9 tok/s).ctest: 51 of 52 pass.ple_parityneeds the Q2_0 model's second shard, which was not present.expert_multi_test(the AVX-512 Q2_0 kernel) is now registered on x86 only.tools/test_setup_*.py: pass, excepttest_setup_choices, which fails the same way on unmodifiedmainon this machine (find_nvcc).test_setup_unslothsimulates an x86 PC and now pinssetup.ARMtoFalse, as it already pins the CPU and GPU.Not covered
--vision): built with the ARM flags, not tested.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.