# deepseek-v4-flash-dspark-src — build DeepSeek-V4-Flash DSpark from the b12x fork EXPERIMENTAL. Builds a DeepSeek-V4-Flash DSpark serving image **from source**, so we are not locked to the prebuilt `aidendle94/sparkrun-vllm-ds4-gb10` image. Stack (pinned in `versions.env`): | Layer | Pin | |---|---| | vLLM fork | `local-inference-lab/vllm` @ `feat/gg-ds4-0731-launcher` = `e63a190ee` | | torch | `2.12.0+cu130` | | FlashInfer | `ce40d25a` (0.6.15), built from source | | b12x | `voipmonitor/b12x` @ `284a2ea` | | NCCL | `5067397c` | | CUDA base | `nvidia/cuda:13.2.0-devel-ubuntu24.04` @ pinned digest | | arch | aarch64 / `sm_121a` | The python locks were regenerated from the **fork's own `requirements/`** at the pinned commit (torch 2.12.0, flashinfer 0.6.15, cutlass-dsl 4.6.0, tokenspeed/humming-kernels), not from the GLM-5.2 harness locks (which pin torch 2.11 / flashinfer 0.6.12 and are therefore invalid for this stack). ## Workflow 1. Reset/refresh the locks (only needed when the fork pins change): ```bash bash gen-locks.sh # writes locks/python-build.txt & python-runtime.txt ``` 2. Build: ```bash TAG=vllm-ds4-dspark-src:probe bash build.sh ``` via the launcher on a build node: ```bash sm121 build --recipe deepseek-v4-flash-dspark-src --build-node dgx3.lan ``` This uploads this directory, runs `build.sh` (torch wheels + from-source FlashInfer/vLLM + b12x editable) in a tmux build session, and stamps the `sm121.checksum` label. ## Notes / caveats - **Multi-hour build.** Expect 1–3h+ on a DGX Spark; runs in tmux on the node. - The runtime lock pins flashinfer 0.6.14 (from the fork's `requirements/cuda.txt`) but we then install the **0.6.15 from-source wheel** over it — the built wheel wins. If pip objects to install-order, pin the runtime lock differently. - FlashInfer 0.6.15 is built from source and installed with `--no-deps`, so its own `install_requires` are never auto-resolved into the lock. `gen-locks.sh` therefore re-adds its hard transitive deps explicitly (**cuda-tile==1.5.0**) and **nccl4py==0.3.1**) so `pip check` passes. `deep-gemm` (sdist-only) and `vllm-flash-attn` (x86-only) have no aarch64 wheel and are not required by the fork's vLLM, and `ray` is not needed on the `mp` distributed backend — so all three stay out of the aarch64 runtime lock. Note the import names differ from the PyPI names: cuda-tile → `cuda.tile`, nccl4py → `nccl`. - `overlay/` and `patches/` are intentionally empty (GLM-specific pieces dropped); add DS4 patches here if the fork needs a local fix. - Config/flags for serving mirror the fork's `serve-ds4-flash-spark.sh`.