Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. # syntax=docker/dockerfile:1.7
  2. # Qwen3.8-Flash-Next-NVFP4 on DGX Spark (SM121 / GB10).
  3. #
  4. # Base: lmsysorg/sglang:qwen38flashnext — SGLang day-0 for qwen4_exp (arm64,
  5. # model support = sgl-project/sglang PR #36497 baked in). It CANNOT serve this
  6. # model on GB10 stock: QSA's packed varlen decode resolves to flash-attn-4
  7. # CuTe-DSL kernels that fail MLIR compilation on SM121.
  8. #
  9. # This layer swaps in a Triton FlashDecoding-style fallback (CUDA-graph-safe)
  10. # for non-SM100 devices. Provenance + validation:
  11. # https://github.com/MiaAI-Lab/Qwen3.8-Flash-Next-Dual-DGX-Sparks
  12. # (validated end-to-end TP=2 over RoCE on this cluster; single + 2-node
  13. # dummy boots with prefill, decode CUDA graphs and NEXTN spec decode).
  14. ARG BASE_IMAGE
  15. FROM ${BASE_IMAGE}
  16. # The Triton fallback kernel (installed next to the QSA backend).
  17. COPY patches/qsa_fa_fallback.py \
  18. /sgl-workspace/sglang/python/sglang/srt/layers/attention/qsa_fa_fallback.py
  19. # Inject the SM121 early-return into the QSA varlen resolver.
  20. COPY patches/patch_qsa_sm121.py /tmp/patch_qsa_sm121.py
  21. RUN set -eux; \
  22. SRC="$(python3 -c 'import sglang, os; print(sglang.__path__[0])')"; \
  23. python3 /tmp/patch_qsa_sm121.py --check; \
  24. python3 /tmp/patch_qsa_sm121.py; \
  25. python3 /tmp/patch_qsa_sm121.py --check; \
  26. python3 -m py_compile \
  27. "$SRC/srt/layers/attention/qwen_sparse_attn_backend.py" \
  28. "$SRC/srt/layers/attention/qsa_fa_fallback.py"; \
  29. rm -f /tmp/patch_qsa_sm121.py