Sharing a vLLM(B12X-optimized) Raon-1-mini NVFP4 image and serving guide for DGX Spark (SM121)

#8
by Pilcothink - opened

https://github.com/gpdev-Pilcothink/DGX_Spark_vllm_Dockerfile/tree/main/0.32/Raon1-mini

The link above contains the Docker image and an easy vLLM serving guide for Raon-1-mini-preview NVFP4.

2027 ํฌ๋ž˜ํ”„ํ†ค๊ณผ ์ข‹์€ ์ธ์—ฐ์ด ๋˜๊ธฐ๋ฅผ ๊ธฐ๋Œ€ํ•˜๋ฉฐ.., ์ตœ์ ํ™” ๋ฐ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•œ DGX Spark์šฉ ๊ฐ€์ด๋“œ(๋„์ปค์ด๋ฏธ์ง€) ๋ฐ ์–‘์žํ™” ๋ชจ๋ธ์„ ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค.

๊ฐœ์ธ์ ์œผ๋กœ Raon-1-mini๋Š” ๊ฒŒ์ž„ NPC์— ํƒ‘์žฌํ•˜๊ธฐ ์ข‹์€ ํ•œ๊ตญ ๋ชจ๋ธ์ด๋ผ๊ณ  ์ƒ๊ฐ์ด ๋“œ๋„ค์š”. ์—ฌ๋Ÿฌ NPC๋ฅผ ์„œ๋ฒ„์—์„œ ๋™์‹œ์— ์ฒ˜๋ฆฌํ•œ๋‹ค๋ฉด ์ฒ˜๋ฆฌ๋Ÿ‰๊ณผ ๋น„์šฉ ํšจ์œจ๋„ ์ค‘์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ, ๋‹จ์ผ ์š”์ฒญ๋ฟ ์•„๋‹ˆ๋ผ ๋™์‹œ ์š”์ฒญ ์„ฑ๋Šฅ ๊ฐœ์„ ์—๋„ ์‹ ๊ฒฝ์„ ์ผ์Šต๋‹ˆ๋‹ค. ํŠนํžˆ ์ œ๊ฐ€ ์–‘์žํ™”๋ฅผ ์ง„ํ–‰ํ•œ Dflash2-nvfp4 ๋ชจ๋ธ์€ GB300๊ฐ™์€ ๊ธฐ๊ธฐ์—์„œ๋„ ์ œ๋Œ€๋กœ ์ž‘๋™ํ• ํ…๋ฐ, ๋ˆ„๊ตฐ๊ฐ€ ํ•ด๋‹น ๊ธฐ๊ธฐ์—์„œ ์จ๋ณด์…จ์œผ๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.

ํ”„๋ฆฌ๋ทฐ๊ฐ€ ์•„๋‹Œ ์ •์‹ ์ถœ์‹œ ๋ชจ๋ธ์—๋Š” DFlash ๋Œ€์‹  MTP ๋ฐฉ์‹์˜ ๋“œ๋ž˜ํ”„ํŠธ๊ฐ€ ์ ์šฉ๋˜๋ฉด ์ข‹๊ฒ ๋‹ค๋Š” ์ƒ๊ฐ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค.
MTP์˜ ์ˆ˜๋ฝ๋ฅ ์ด ๋†’๊ฒŒ ์œ ์ง€๋˜๊ณ  NVFP4 ์–‘์žํ™”๊นŒ์ง€ ์ ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด, ๋“œ๋ž˜ํ”„ํŠธ ์—ฐ์‚ฐ ๋น„์šฉ์„ ์ค„์—ฌ ์„œ๋ฒ„์—์„œ ๋” ํฐ ๋ฐฐ์น˜๋ฅผ ํšจ์œจ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

RTX 5090์ด๋‚˜ RTX PRO 6000์—์„œ๋„ ํ…Œ์ŠคํŠธํ•ด ๋ณด๊ณ  ์‹ถ์ง€๋งŒ ํ•ด๋‹น ์žฅ๋น„๊ฐ€ ์—†์–ด์„œ ๋งค์šฐ ์•„์‰ฝ๋„ค์š” ใ…œใ…œ (ํ…Œ์ŠคํŠธ ํ•ด์ค„ ์‚ฌ๋žŒ์„ ์ฐพ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.)

What changed

KRAFTON already provides a DGX Spark image for Raon-1-mini-preview NVFP4. I developed a separate image using a newer vLLM version and B12X kernels to explore overall performance improvements on a single DGX Spark.

The image uses:

  • vLLM 0.32.0
  • B12X Linear and MoE [https://github.com/local-inference-lab/flashinfer]
  • A custom B12X_MLA adapter for target MLA decode and speculative verification
  • FP8 E4M3 target KV cache
  • A quantized DFlash2 NVFP4 W4A4 draft
  • A separately quantized NVFP4 W4A4 draft output head
  • FLASH_ATTN draft attention
  • 4 speculative tokens
  • Probabilistic drafting and block rejection sampling
  • Async scheduling and FULL decode CUDA graphs

The DFlash2 draft and its output head were quantized using NVIDIA Model Optimizer.

Models:

Performance comparison

The following llama-benchy results compare KRAFTON's original DGX Spark image with my B12X image on a single DGX Spark.

The images use different vLLM implementations and serving configurations, so this is an image-level comparison, not a measurement of one optimization in isolation.

Single-request tests

Test KRAFTON image B12X image Change
pp2048, tg128 run 3,957.45 ยฑ 37.69 tok/s 6,614.65 ยฑ 188.99 tok/s +67.1%
tg128 57.54 ยฑ 2.71 tok/s 71.95 ยฑ 3.21 tok/s +25.0%
pp2048, tg1024 run 4,737.45 ยฑ 324.32 tok/s 6,811.57 ยฑ 57.61 tok/s +43.8%
tg1024 63.10 ยฑ 1.17 tok/s 71.25 ยฑ 4.64 tok/s +12.9%
pp2048 @ d1024, tg128 run 5,392.41 ยฑ 136.57 tok/s 6,269.53 ยฑ 197.09 tok/s +16.3%
tg128 @ d1024 51.31 ยฑ 6.72 tok/s 70.25 ยฑ 6.97 tok/s +36.9%
pp2048 @ d1024, tg1024 run 4,657.61 ยฑ 1,367.24 tok/s 6,146.96 ยฑ 170.35 tok/s +32.0%
tg1024 @ d1024 58.22 ยฑ 6.58 tok/s 67.23 ยฑ 2.90 tok/s +15.5%
pp2048 @ d4096, tg128 run 5,900.02 ยฑ 284.13 tok/s 6,541.13 ยฑ 103.36 tok/s +10.9%
tg128 @ d4096 51.70 ยฑ 4.05 tok/s 74.07 ยฑ 6.89 tok/s +43.3%
pp2048 @ d4096, tg1024 run 6,165.15 ยฑ 247.25 tok/s 6,506.45 ยฑ 100.87 tok/s +5.5%
tg1024 @ d4096 54.17 ยฑ 1.63 tok/s 68.02 ยฑ 2.39 tok/s +25.6%

Concurrent requests

These figures show total output throughput. Concurrency is the number of requests submitted by the benchmark.

Test KRAFTON image B12X image Change
tg256 @ d1024, c1 56.51 ยฑ 2.00 tok/s 78.64 ยฑ 4.06 tok/s +39.2%
tg256 @ d1024, c10 118.89 ยฑ 2.14 tok/s 179.39 ยฑ 4.41 tok/s +50.9%
tg256 @ d1024, c50 146.23 ยฑ 2.03 tok/s 254.79 ยฑ 1.56 tok/s +74.2%

At 50 concurrent requests, total output throughput increased from 146.23 to 254.79 tok/s.

Long context: 100K depth

Metric KRAFTON image B12X image Change
pp2048 @ d100000 4,100.50 ยฑ 7.39 tok/s 3,931.13 ยฑ 181.86 tok/s โˆ’4.1%
tg512 @ d100000 33.23 ยฑ 1.51 tok/s 54.44 ยฑ 5.06 tok/s +63.8%
Time to first response 24,893.14 ยฑ 44.89 ms 26,021.91 ยฑ 1,205.14 ms +4.5%

At 100K depth, generation throughput increased from 33.23 to 54.44 tok/s โ€” approximately 63.8% faster โ€” while prefill throughput remained close to the original image.

With MLA, longer contexts require each decode step to read and process more cached data, which can reduce generation speed.

Some earlier long-context runs experienced memory pressure or unexpected engine termination. I am continuing to check long-context stability.

Quality evaluation

For the tool-calling evaluation and its detailed results, please see my NVIDIA Developer Forum post:

https://forums.developer.nvidia.com/t/let-s-optimize-raon-1-mini-preview-nvfp4-for-single-dgx-spark/387340

Looking for SM120 testers

I would love to test this setup on an RTX 5090 or RTX PRO 6000 Blackwell, but I do not have access to either device.

If you have one of these GPUs and would be interested in testing, please contact me or share your results here.

KRAFTON org

Hi @Pilcothink , thank you for putting this together and sharing it! The B12X-optimized image and the NVFP4 DFlash2 draft are really nice work, and we appreciate how carefully you laid out the llama-benchy results, especially the image-level caveat and the notes on long-context stability.

We have RTX PRO 6000 Blackwell and RTX 5090 machines, so we'll try your image on SM120 when we get the chance and share the results here. Thanks also for the suggestion about an MTP-style draft for the non-preview release. We'll take it into account.

Unfortunately, the current image is still ARM-based and designed exclusively for DGX Spark. I'll build an SM120-compatible image and provide an updated Docker image.

# ์ด๋ฏธ์ง€์™€ ๋ชจ๋ธ ๋‹ค์šด๋กœ๋“œ
docker pull pilcothink/vllm_pc:0.32-Raon-1-v4

hf download KRAFTON/Raon-1-mini-preview-nvfp4 \
  --local-dir /path/Model/Raon-1-mini-preview-nvfp4

hf download Pilcothink/Raon-1-mini-preview-dflash2-nvfp4 \
  --local-dir /path/Model/Raon-1-mini-preview-dflash2-nvfp4

/path๋ฅผ ๋ชจ๋ธ์„ ์ €์žฅํ•œ ๊ฒฝ๋กœ๋กœ ๋ฐ”๊ฟ” ์‹คํ–‰ํ•˜์„ธ์š”.

HOST_AI_DIR=/path

docker run --rm -it \
  --gpus all \
  --network host \
  --ipc=host \
  --ulimit memlock=-1 \
  --ulimit stack=67108864 \
  -v "$HOST_AI_DIR:/workspace" \
  -v "$HOME/.cache/raon-vllm-pc:/root/.cache" \
  -e CUTE_DSL_ARCH=sm_120a \
  -e VLLM_WORKER_MULTIPROC_METHOD=spawn \
  -e VLLM_USE_V2_MODEL_RUNNER=1 \
  --entrypoint vllm \
  pilcothink/vllm_pc:0.32-Raon-1-v4 \
  serve /workspace/Model/Raon-1-mini-preview-nvfp4 \
    --served-model-name Raon-1-mini-preview \
    --host 0.0.0.0 \
    --port 8000 \
    --trust-remote-code \
    --tensor-parallel-size 1 \
    --decode-context-parallel-size 1 \
    --dtype bfloat16 \
    --load-format safetensors \
    --linear-backend b12x \
    --moe-backend b12x \
    --no-enable-flashinfer-autotune \
    --attention-backend B12X_MLA \
    --attention-config '{"flash_attn_version":2}' \
    --kv-cache-dtype fp8_e4m3 \
    --mamba-cache-mode align \
    --enable-prefix-caching \
    --enable-chunked-prefill \
    --async-scheduling \
    --max-model-len 32768 \
    --max-num-seqs 4 \
    --max-num-batched-tokens 2048 \
    --gpu-memory-utilization 0.80 \
    --compilation-config '{"mode":0,"cudagraph_mode":"FULL_DECODE_ONLY"}' \
    --speculative-config '{"method":"dflash","model":"/workspace/Model/Raon-1-mini-preview-dflash2-nvfp4","num_speculative_tokens":4,"draft_sample_method":"probabilistic","rejection_sample_method":"block","attention_backend":"FLASH_ATTN","kv_cache_dtype":"auto","moe_backend":"auto"}' \
    --reasoning-parser raon_1 \
    --tool-call-parser raon_1 \
    --enable-auto-tool-choice \
    --default-chat-template-kwargs '{"enable_thinking":true,"truncate_history_thinking":false}'

Sign up or log in to comment