Run VLLM in Spark

Yes, it should compatible

I have successfully run vLLM on Spark. Trick is simple: recompile PyTorch from source with at least CUDA 12.9, then recompile vLLM from source too.

you can use pytorch 2.9.1+cu130. In fact I recommend that version

I keep running into this and don’t know how to proceed:

ImportError: libtorch_cuda.so: cannot open shared object file: No such file or directory

Although it falls back to Marlin’s weight-only FP4, at this point, using the method introduced in this thread, the gpt-oss-120b series model now works even on a single DGX Spark. Thank you very much!

FP4 support is not there yet for Vllm on consumer Blackwell (at least not on GB10), so you will get better performance using AWQ quants. For 8 bit, FP8 will give you better performance than AWQ 8-bit though.

hello,

it is supported: [Kernel] Add NVFP4 MoE CUTLASS support for SM120 by mgoin · Pull Request #29242 · vllm-project/vllm · GitHub

It is for SM120 though. I tried to change TORCH archs list to 12.0f, and getting the same results.

EDIT: looks like it gets compiled in either case, but still not working, at least for Qwen3 MOE.

Here is what I’m seeing:

(EngineCore_DP0 pid=124) INFO 12-01 19:27:25 [gpu_model_runner.py:3469] Starting to load model RedHatAI/Qwen3-30B-A3B-NVFP4...
(EngineCore_DP0 pid=124) INFO 12-01 19:27:25 [compressed_tensors_w4a4_nvfp4.py:63] Using flashinfer-cutlass for NVFP4 GEMM
(EngineCore_DP0 pid=124) [2025-12-01 19:27:25] INFO _optional_torch_c_dlpack.py:119: JIT-compiling torch-c-dlpack-ext to cache...
(EngineCore_DP0 pid=124) INFO 12-01 19:27:36 [cuda.py:411] Using FLASH_ATTN attention backend out of potential backends: ['FLASH_ATTN', 'FLASHINFER', 'TRITON_ATTN', 'FLEX_ATTENTION']
(EngineCore_DP0 pid=124) INFO 12-01 19:27:36 [layer.py:379] Enabled separate cuda stream for MoE shared_experts
(EngineCore_DP0 pid=124) INFO 12-01 19:27:36 [compressed_tensors_moe.py:221] Using Cutlass for CompressedTensorsW4A4Nvfp4MoEMethod.
(EngineCore_DP0 pid=124) WARNING 12-01 19:27:36 [compressed_tensors.py:721] Acceleration for non-quantized schemes is not supported by Compressed Tensors. Falling back to UnquantizedLinearMethod

it crash afterwards? seems only warning

no, it works, but slower than AWQ quants. Looks like it falls back to some slower kernerls.

hey @eugr great info can you please help with a guide how we can run this its really hard to follow through the thread

Hi @johnny_nv, thanks, I can confirm it works, I was able to test the recent mistralai/Ministral-3-14B-Reasoning-2512 model

Engine 000: Avg prompt throughput: 0.8 tokens/s, Avg generation throughput: 1.7 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%, MM cache hit rate: 0.0%
(APIServer pid=26566) INFO 12-03 21:00:49 [loggers.py:248] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 9.0 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%, MM cache hit rate: 0.0%
(APIServer pid=26566) INFO 12-03 21:00:59 [loggers.py:248] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 9.1 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.0%, Prefix cache hit rate: 0.0%, MM cache hit rate: 0.0%
(APIServer pid=26566) INFO 12-03 21:01:09 [loggers.py:248] Engine 000: Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 9.0 tokens/s, Running: 1 reqs, Waiting: 0 reqs, GPU KV cache usage: 0.1%, Prefix cache hit rate: 0.0%, MM cache hit rate: 0.0%

I also observed that after closing the vLLM instance, I did not manually flush the buffer cache using the command sudo sh -c ‘sync; echo 3 > /proc/sys/vm/drop_caches’. I skipped this step. That’s great!

Hi Everyone, I’ve had tremendous success with @vince_du_66 dockerfile and @eugr patch for the vllm serving. I’m curious about one thing, I figured until now that separate docker containers of vLLM would be required for multiple models.

Came across this article where multiple models in a catalog are loaded in and allegedly can be loaded and swapped very quickly. How can i edit the starter scripts to serve multiple models like this ?

Not sure how it is different from fastsafetensors that are already battle tested and incorporated into vllm (and with the patch work in cluster setups)?

A few other notes in no particular order:

  1. The guy in the article doesn’t seem to own Spark - the numbers in the table are “expected”.
  2. The LinkedIn article is basically a copy-paste from flashtensors README with no first-hand experience.
  3. In vllm, loading safetensors is just one step, sometimes not even the longest. With fastsafetensors, loading time can be reduced significantly (and no, not to the same level as in the Github examples, because Spark doesn’t support GDS*). However, there are a lot of other steps, taking more time - for instance, building CUDA graphs. And even loading VLLM libraries, which it does twice currently.
  4. There is a way to swap models much faster by caching CUDA graphs and other Torch structures - see Sleep mode in VLLM, although I haven’t tested it yet.

* - on GDS. Looks like it can be forced, but will result in weights corruption as described in this issue

Hi all, was running into similar issues w/ nvfp4 MoE on the nvidia vLLM container so made a similar Dockerfile then found this thread, similar to all approaches just w/ few tweaks dgx-spark-utilities/scripts/Dockerfile.vllm at main · shaunsingh/dgx-spark-utilities · GitHub

It also bundles a patched PyTorch & Triton as well, measurably quicker to work with, getting 2x the inference speed & much more stable

Though by default it patches torch to use tf32 & not ieee for fp32 so tread carefully there and give it a good read, feedback welcome as well, I just whipped this up as issues cropped up

Some benchmarks across the various providers as well w/ some runtime scripts, don’t look into it too much, they are not a the same settings but getting a feel for the performance dgx-spark-utilities/results.txt at main · shaunsingh/dgx-spark-utilities · GitHub

& credit to @mark440 & @eugr for a good bit of the basis here, I don’t recommend using the .sh files, they are just shims for automated testing.

Getting ~100tk/s on GLM4.5Air & Derivatives at reasonable precision/accuracy, this obviously builds everything from main etc., I’ve only tested it for our needs, I wouldn’t be surprised if it is unstable elsewhere

This is for NVFP4, right? Can you run some benches for RedHatAI/Qwen3-30B-A3B-NVFP4 for 1, 10 and 100 concurrent requests to see how that compares to what I’m getting without patched PyTorch?

I’ve also ended up incorporating triton/triton-kernels build from github, but I pinned it to v3.5.1 for now - main branch is missing matmul_ogs for some reason. Tried one patched python version from one of the Reddit threads, but didn’t see any performance gains, so rolled back to official cu130 wheels.

I’ll see if I can incorporate some of your stuff into my builds though, thanks!

Yes, for NVFP4, Will give it a shot, was running into some incompatibility w/ the official 130 wheel, can’t recall what, Will give Qwen a shot

BTW, Qwen3-VL support was broken for a few days - make sure you rebuild today because they have just merged a fix. I spent a few hours yesterday trying to figure out what I broke in my redesigned Docker setup, just to trace it to the changes in vLLM :)


vllm cu13 is coming :)

cool, thanks for letting us know!