Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions unsloth_zoo/vllm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,14 @@ def load_vllm(

is_fp8 = "fp8" in model_name.lower() or (quant_method in ("fp8", "fbgemm_fp8"))

if is_fp8:
major_version, minor_version = torch.cuda.get_device_capability()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard FP8 deepgemm toggle behind CUDA checks

load_vllm has explicit non-CUDA paths (including XPU), but this new FP8 branch unconditionally calls torch.cuda.get_device_capability(). On Intel/XPU environments, loading an FP8 model now fails immediately with a CUDA runtime error before vLLM initialization, which is a regression for that code path. Please gate this capability query on DEVICE_TYPE == "cuda" (or use the existing device abstraction) before touching CUDA APIs.

Useful? React with 👍 / 👎.

if major_version == 10:
# It is noticed that Deepgemm is generally slower than triton for vLLM
# https://x.com/TheZachMueller/status/2024619480580510117?s=20
# This might get implemented in vLLM later but till then we have this toggle
os.environ['VLLM_USE_DEEP_GEMM'] = '0'

assert not (use_bitsandbytes and is_fp8), f'`load_in_4bit` and `load_in_8bit` should be set to false for loading FP8 quantized models with fast inference'

max_num_batched_tokens, approx_max_num_seqs, \
Expand Down