Skip to content

swift sample中vllm参数问题 #9207

@jjh021027

Description

@jjh021027

Checklist / 检查清单

  • I have searched existing issues, and this is a new question or discussion topic. / 我已经搜索过现有的 issues,确认这是一个新的问题与讨论。

Question Description / 问题描述

#!/bin/bash

1. 显卡配置

export CUDA_VISIBLE_DEVICES=1
export VLLM_USE_MODELSCOPE=False
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export export IMAGE_MAX_TOKEN_NUM=1024

2. 路径配置

BASE_PATH="/home/c/models/Qwen3-VL-4B-Instruct"
CHECKPOINT_PATH=
DATASET_PATH=

3. 公共采样参数 (专为 swift sample 适配)

COMMON_ARGS=(
--model "$BASE_PATH"
--adapters "$CHECKPOINT_PATH"
--sampler_engine vllm
--dataset "$DATASET_PATH"
--dtype float16
--torch_dtype float16
--engine_kwargs '{"gpu_memory_utilization": 0.85,"max_model_len": 4096, "enforce_eager": true}'
--max_new_tokens 2048
--top_p 0.95
--top_k 50
)

echo "============================================="
echo " 启动 vLLM 单卡引擎..."
echo "============================================="

echo "=> [GPU 2] 正在执行 T=0.4, N=8 ..."
swift sample "${COMMON_ARGS[@]}"
--temperature 0.4
--num_return_sequences 8
--output_file "sample_t0.4_n8.jsonl"

echo "=> [GPU 2] 正在执行 T=1.1, N=8 ..."
swift sample "${COMMON_ARGS[@]}"
--temperature 1.1
--num_return_sequences 8
--output_file "sample_t1.1_n8.jsonl"

echo " 任务全部完成!"
硬件V100,需要配置dtype: float16,但是ms-swift 的代码中,VllmEngine 类的 init 函数并没有把 dtype 这个参数开放出来接收,配置torch_type依旧失败,报错keyerro.请问当前条件下如果设置?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions