Dockerfile 1.8 KB

1234567891011121314151617181920212223242526272829303132
  1. # syntax=docker/dockerfile:1.7
  2. # DeepSeek-V4-Flash-DSpark on aidendle94 sparkrun-vllm-ds4-gb10:production-3.8,
  3. # with a root-cause patch for BUG-2026-08-03T204037.
  4. #
  5. # The REAL blocker (found by boot-testing on ds4) is NOT the DeepGEMM
  6. # `t.dim() == N` assertion from the original bug write-up. On this image the
  7. # DSV4 target + drafter load cleanly via the b12x MoE backend — DeepGEMM scale
  8. # packing never fires. Boot instead crashes during KV-cache profiling
  9. # (profile_run -> dummy forward, under torch.compile/AOT), inside
  10. # b12x/integration/residual_kernels.py `_to_kernel_tensor`:
  11. #
  12. # from_dlpack(tensor, ...) -> tensor.__dlpack__()
  13. # BufferError: Can't export tensors that require gradient, use tensor.detach()
  14. #
  15. # Under torch.compile the norm parameter carries requires_grad=True (inductor
  16. # keeps an autograd graph), and cutlass's from_dlpack refuses grad-requiring
  17. # tensors. Fix: detach the tensor before dlpack export — a no-op for the
  18. # requires_grad=False case, correct for the compiled case.
  19. FROM aidendle94/sparkrun-vllm-ds4-gb10:production-3.8
  20. # Patch 1: b12x cutlass from_dlpack rejects grad-requiring tensors under
  21. # torch.compile (BufferError during KV-cache profiling). detach() before export.
  22. RUN sed -i \
  23. 's/from_dlpack(tensor, assumed_align=assumed_align)/from_dlpack(tensor.detach(), assumed_align=assumed_align)/' \
  24. /opt/env/lib/python3.12/site-packages/b12x/integration/residual_kernels.py \
  25. && grep -n 'from_dlpack(tensor' /opt/env/lib/python3.12/site-packages/b12x/integration/residual_kernels.py
  26. # Patch 2: drafter wo_a DeepGEMM fp8_einsum rank bug — reshape wo_a weight +
  27. # scale to (n_groups, o_lora_rank, -1) before the bmm (see patch script).
  28. COPY patches/patch_dspark_woa.py /tmp/patch_dspark_woa.py
  29. RUN /opt/env/bin/python3 /tmp/patch_dspark_woa.py