1
Qwen
新人贴
使用 VLLM 提供 gpt-oss 服务
2025-12-03 16:54:08
192

我正在寻找一种方法,在  K100-AI 上使用 VLLM 从 Hugging Face 部署 openai/gpt-oss-20b。据我所知,VLLM 从 v0.10.1 版本开始集成了 gpt-oss。我目前知道的两个 VLLM 镜像分别是:

- 192.168.162.66:8888/opt:3.2-rc1-ubuntu22.04-py310-torch2.6 (VLLM 版本 0.8.2,torch 版本 v2.6.0,triton 版本)

- image.sourcefind.cn:5000/dcu/admin/base/vllm:0.8.5-ubuntu22.04-dtk25.04.1-py3.10 (VLLM 版本 0.8.5)

这两个版本都不支持 VLLM 0.10.1,因此无法运行 gpt-oss。我尝试在 VLLM 0.8.2 镜像上集成 gpt-oss,但遇到了一些问题:

- openai/gpt-oss 需要 MXFP4 量化。

- MXFP4 量化需要 FlashInfer 后端(K100-AI 不支持,因为它是 NVIDIA 的专用后端)和 triton_kernels。

- triton_kernels 仅在 triton 3.4.0 及更高版本中受支持,并且还需要 torch 2.8.0 版本。因此,当我尝试运行 `vllm serve gpt-oss` 时,出现错误:

```

(EngineCore_0 pid=4921) ERROR 12-02 06:41:27 [core.py:700]   File "/vllm/vllm/model_executor/layers/quantization/mxfp4.py", line 388, in process_weights_after_loading

(EngineCore_0 pid=4921) ERROR 12-02 06:41:27 [core.py:700]     from triton_kernels.matmul_ogs import FlexCtx, PrecisionConfig

(EngineCore_0 pid=4921) ERROR 12-02 06:41:27 [core.py:700] ModuleNotFoundError: No module named 'triton_kernels'

```

然后我尝试使用 `pip install` 从 https://download.pytorch.org/whl/rocm6.3 下载 torch 并更新到 2.8.0 版本。然而,在运行模型时出现设备错误:

 ```

   File "/usr/local/lib/python3.10/dist-packages/torch/_inductor/kernel/mm_common.py", line 401, in <module>

     mm_platform_configs = build_rocm_gemm_configs(mm_platform_configs)

   File "/usr/local/lib/python3.10/dist-packages/torch/_inductor/kernel/mm_common.py", line 37, in build_rocm_gemm_configs

     rocm_num_stages = get_backend_num_stages()

   File "/usr/local/lib/python3.10/dist-packages/torch/_inductor/utils.py", line 1846, in get_backend_num_stages

     options = get_backend_options()

   File "/usr/local/lib/python3.10/dist-packages/torch/_inductor/runtime/triton_helpers.py", line 48, in get_backend_options

     target = driver.active.get_current_target()

   File "/usr/local/lib/python3.10/dist-packages/triton/backends/amd/driver.py", line 523, in get_current_target

     device = self.get_current_device()

   File "/usr/local/lib/python3.10/dist-packages/torch/cuda/__init__.py", line 1026, in current_device

     _lazy_init()

   File "/usr/local/lib/python3.10/dist-packages/torch/cuda/__init__.py", line 372, in _lazy_init

     torch._C._cuda_init()

 RuntimeError: No HIP GPUs are available

 ```


我尝试运行以下命令:

```

python3 -c "import torch; print(torch.cuda.is_available())"

```

看来 torch 已被修改以兼容 K100-AI 设备。

因此,我希望找到一个提供 VLM 且支持运行 openai/gpt-oss mxfp4(至少从 0.10.2 版本开始)的镜像。或者,是否有办法调试上述 torch 错误,以便我可以在旧版本的 VLM 镜像上运行 gpt-oss?

全部评论(6)
只看楼主
M
Mr Liu
2楼
@Hikafeng,请问vllm 0.11版本的专用镜像发布了吗,我在光源的镜像中心没看到:https://sourcefind.cn/#/image/dcu/vllm?activeName=overview,能贴一下地址吗
2025/12/25
Hikafeng
1楼
等 0.11版的专用镜像发布,应该是这周
2025/12/3
M
moreh
回复 @Hikafeng
谢谢,如果您有时间,请查看收件箱。
2025/12/3
网
网友vQLBnh
回复 @Hikafeng
使用harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.11.0-ubuntu22.04-dtk26.04-0130-py3.10-20260202这个镜像,然后运行vllm serve gpt-oss-120b --served-model-name gpt-oss-120b --max-model-len 32768 -tp 4 --gpu-memory-utilization 0.9 ,报错:
(Worker_TP3 pid=9026) ERROR 02-05 15:17:09 [multiproc_executor.py:597] return Mxfp4MoEMethod(layer.moe_config)
(Worker_TP3 pid=9026) ERROR 02-05 15:17:09 [multiproc_executor.py:597] File "/usr/local/lib/python3.10/dist-packages/vllm/model_executor/layers/quantization/mxfp4.py", line 166, in __init__
(Worker_TP3 pid=9026) ERROR 02-05 15:17:09 [multiproc_executor.py:597] assert self.mxfp4_backend != Mxfp4Backend.NONE, (
(Worker_TP3 pid=9026) ERROR 02-05 15:17:09 [multiproc_executor.py:597] AssertionError: No MXFP4 MoE backend (FlashInfer/Marlin/Triton) available.Please check your environment and try again.
还是不行呢
2/5
Hikafeng
回复 @网友vQLBnh
国产的不支持FP4 甚至FP8都不是很支持,所以请使用FP16版的模型
2/6
全部4条回复
没有更多内容了
--
楼主
Level.3
0 帖子
楼主热帖
暂无数据