ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

Open wolfvoid opened this issue 7 months ago • 14 comments

Checklist / 检查清单

  • [x] I have searched existing issues, and this is a new bug report. / 我已经搜索过现有的 issues,确认这是一个新的 bug report.

Bug Description / Bug 描述

When training Qwen3.5-4B with GRPO using DeepSpeed multi-GPU setup, the training crashes during vLLM engine initialization with the following error:

ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

The error occurs in vllm/model_executor/layers/mamba/gdn_linear_attn.py when the GDN attention kernel tries to access tensors on non-zero CUDA devices.

Environment / 环境信息

  • ms-swift: 4.2.0dev0
  • Python: 3.10
  • PyTorch: 2.10.0
  • Triton: 3.6.0
  • vLLM: 0.19.0 (V1 engine)
  • GPU: NVIDIA H800 × 8
  • DeepSpeed: zero2
  • Training Mode: GRPO (RLHF)

Root Cause Analysis / 根本原因分析

This is a Triton multi-GPU context mismatch bug (similar to triton#2441):

  1. DeepSpeed launches 8 processes (rank0-7), each bound to a different GPU (cuda:0 to cuda:7)
  2. vLLM V1 initializes the Qwen3.5 model which uses GDN (Global Deep Network) Attention
  3. GDN attention internally calls Triton kernels (e.g., fused_gdn_gating_kernel)
  4. Triton kernels default to cuda:0 device context regardless of which GPU the process is using
  5. When rank2 (on cuda:2) tries to launch the kernel with tensors on cuda:2, the cuda:0 context cannot access them
  6. cuPointerGetAttribute returns CUDA_ERROR_INVALID_VALUE, causing the error

Why this happens specifically with Qwen3.5:

  • Qwen3.5 uses a custom GDN attention mechanism in vLLM
  • The VLLM_ATTENTION_BACKEND environment variable does NOT affect Qwen3.5 (it forces GDN usage)
  • This differs from standard attention mechanisms that properly handle multi-GPU contexts

How to Reproduce / 如何复现

# Environment setup
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
export NPROC_PER_NODE=8

# DeepSpeed launch
deepspeed --include localhost:0,1,2,3,4,5,6,7 --master_port 28956 \
    swift/cli/rlhf.py \
    --rlhf_type grpo \
    --model /path/to/Qwen3.5-4B-Base \
    --model_type qwen3_5 \
    --template qwen3_5 \
    --use_vllm true \
    --vllm_mode colocate \
    --vllm_tensor_parallel_size 2 \
    --deepspeed zero2 \
    --num_generations 8 \
    --per_device_train_batch_size 1 \
    --gradient_accumulation_steps 4 \
    --torch_dtype bfloat16 \
    ...

Key trigger conditions:

  • Multi-GPU training (DeepSpeed)
  • --use_vllm true (using vLLM for rollout generation)
  • Qwen3.5 model (uses GDN attention)

Workarounds / 临时解决方案

Option 1: Disable vLLM (Confirmed Working) ✅

Use transformers engine instead of vLLM: --use_vllm false Trade-off: 5-10x slower rollout generation, but training works correctly.

Additional fix needed when using transformers engine: The transformers engine passes all data fields to model.generate(), causing: ValueError: The following model_kwargs are not used by the model: ['solution', 'task_type', ...]

Fix: Filter non-model parameters in transformers_engine.py: swift/infer_engine/transformers_engine.py, line ~388 def _infer_full(self, inputs: Dict[str, Any], *, ...): # Filter out non-model kwargs model_forward_params = set(inspect.signature(self.model.forward).parameters.keys()) filtered_inputs = {k: v for k, v in inputs.items() if k in model_forward_params} generate_kwargs = {'generation_config': generation_config, **filtered_inputs}

Option 2: Use vLLM Server Mode (Not Verified)

--vllm_mode server May avoid context pollution by running vLLM in a separate process.

Trade-off: Requires weight synchronization between processes, doubles GPU memory usage.

Suggested Fix / 建议修复

For ms-swift:

  1. Short-term: Add automatic filtering of non-model parameters in transformers_engine.py when --use_vllm false is used for GRPO training
  2. Long-term: Document the incompatibility between Qwen3.5 + vLLM V1 + DeepSpeed multi-GPU, recommend --use_vllm false for GRPO training with Qwen3.5

For vLLM (upstream):

Fix GDN attention to properly set CUDA device context before Triton kernel launches: vllm/model_executor/layers/mamba/gdn_linear_attn.py with torch.cuda.device(tensor.device): fused_gdn_gating_kernelgrid

Related Issues / 相关 Issues

  • Triton Issue: https://github.com/triton-lang/triton/issues/2441
  • Similar issue in sglang: https://github.com/sgl-project/sglang/issues/10025
  • Related swift issue: #2261

Additional Information / 补充信息

The error only occurs with:

  • vLLM enabled (--use_vllm true)
  • Multi-GPU training (single GPU works fine)
  • Qwen3.5 model (other models using standard attention work fine)

SFT training works because it doesn't use vLLM for generation.

wolfvoid avatar Apr 16 '26 16:04 wolfvoid

If i don't use vllm, the problem is solved. however too slow. hope for solution

wolfvoid avatar Apr 16 '26 16:04 wolfvoid

same envionment, same issue, occured in Qwen3.5-4B 9B 35B when vllm_tensor_parallel_size > 1

zhenfenxiao avatar Apr 20 '26 10:04 zhenfenxiao

Qwen3.5-35B模型遇到相同问题

sumo-s avatar Apr 21 '26 02:04 sumo-s

same problem

yszhli avatar Apr 22 '26 01:04 yszhli

临时解决方案可参考文章:vLLM V0.19.0 + ms-swift GRPO 下 GDN Triton Pointer argument (at 0) cannot be accessed 报错问题复盘与修复总结 ,文中有vllm中修改代码,可正常训练,模型效果待验证 https://zhuanlan.zhihu.com/p/2030319389719933863

yszhli avatar Apr 22 '26 08:04 yszhli

Qwen3.5-35B-A3B 遇到同样问题,跪求解决ww

lkdhy avatar Apr 24 '26 11:04 lkdhy

Can anyone provide a reproduction script? It runs normally on my end using the swift rlhf command.

hjh0119 avatar Apr 25 '26 06:04 hjh0119

Can anyone provide a reproduction script? It runs normally on my end using the swift rlhf command.

非常感谢佬

脚本

注:虽然我用的是megatron-swift,而可以看到 @wolfvoid 上面用的是普通swift,但是我们的训练方式(colocate + 开vllm_tensor_parallel_size)和报错是一样的(根本没到梯度更新的时候,在准备colocate rollout的时候就报错退出),所以应该和megatron的部分基本没有关系。

export MEGATRON_LM_PATH='/xxxx/Megatron-LM'
export OMP_NUM_THREADS=4


LOG_FILE="output/log/xxxx.log"
DATA_FILE="xxxxxx.jsonl" # 无所谓

NPROC_PER_NODE="${NPROC_PER_NODE:-${PET_NPROC_PER_NODE:-8}}"
NNODES="${NNODES:-${PET_NNODES:-${WORLD_SIZE:-1}}}"
NODE_RANK="${NODE_RANK:-${PET_NODE_RANK:-${RANK:-0}}}"
MASTER_ADDR="${MASTER_ADDR:-${PET_MASTER_ADDR:-127.0.0.1}}"
MASTER_PORT="${MASTER_PORT:-${PET_MASTER_PORT:-29500}}"
CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES:-0,1,2,3,4,5,6,7}"

# RUN_LOG_FILE="${LOG_FILE%.log}_n${NNODES}_r${NODE_RANK}_TEST_ONLY_2.log"
RUN_LOG_FILE="${LOG_FILE%.log}_n${NNODES}_r${NODE_RANK}_TEST_ONLY.log"

echo "Training Starts, Logged in: ${RUN_LOG_FILE}"
echo "Distributed config: NNODES=${NNODES}, NODE_RANK=${NODE_RANK}, NPROC_PER_NODE=${NPROC_PER_NODE}, MASTER_ADDR=${MASTER_ADDR}, MASTER_PORT=${MASTER_PORT}"

# MODEL_PATH="../../model/Qwen/Qwen3-30B-A3B-Thinking-2507"
# MODEL_NAME="Qwen3-30B-Thinking-2507"

MODEL_PATH="../../model/Qwen/Qwen3.5-35B-A3B"
MODEL_NAME="Qwen3.5-35B-A3B"

NNODES=${NNODES} \
NODE_RANK=${NODE_RANK} \
MASTER_ADDR=${MASTER_ADDR} \
MASTER_PORT=${MASTER_PORT} \
CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES} \
NPROC_PER_NODE=${NPROC_PER_NODE} \
PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True' \
megatron rlhf \
    --rlhf_type grpo \
    --model $MODEL_PATH \
    --check_model false \
    --output_dir output/model/TEST_ONLY-$MODEL_NAME \
    --dataset $DATA_FILE \
    --no_save_optim true \
    --no_save_rng true \
    --save_safetensors true \
    --context_parallel_size 1 \
    --tensor_model_parallel_size 4 \
    --expert_model_parallel_size 4 \
    --pipeline_model_parallel_size 1 \
    --num_train_epochs 1 \
    --save_steps 10 \
    --global_batch_size 1024 \
    --micro_batch_size 4 \
    --steps_per_generation 1 \
    --num_generations 8 \
    --external_plugins /xxx/new_plugin.py \  # 无所谓
    --reward_funcs external_xxxxx \          # 无所谓
    --vllm_mode colocate \
    --vllm_gpu_memory_utilization 0.3 \
    --vllm_tensor_parallel_size 4 \
    --vllm_max_model_len 10240 \
    --max_completion_length 8192 \
    --max_length 2048 \
    --tuner_type full \
    --lr 8e-7 \
    --lr_warmup_fraction 0.1 \
    --lr_decay_style cosine \
    --bf16 true \
    --beta 0.001 \
    --finetune \
    --importance_sampling_level sequence \
    --dynamic_sample false \
    --overlong_filter true \
    --loss_type grpo \
    --sleep_level 1 \
    --offload_model false \
    --offload_bridge true \
    --offload_optimizer true \
    --optimizer_cpu_offload true \
    --vllm_enforce_eager false \
    --use_precision_aware_optimizer \
    --logging_steps 1 \
    --recompute_granularity selective \
    --dataloader_num_workers 8 \
    --dataset_num_proc 8 \
    --attention_backend flash \
    --temperature 1.0 \
    --padding_free true \
    --sequence_parallel true \
    --log_completions true \
    > ${RUN_LOG_FILE} 2>&1

环境信息

  • ms-swift: 4.2.0dev0
  • Python: 3.12.0
  • PyTorch: 2.10.0
  • Triton: 3.6.0
  • vLLM: 0.19.0 (V1 engine)
  • transformer: 5.3.0
  • apex: 0.1
  • mcore_bridge: 1.1.2
  • megatron-core: 0.16.1
  • flash_attn: 2.8.3
  • GPU: H200 × 8

报错输出

ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

具体是:

[rank6]:   File "xxxx/torch/nn/modules/module.py", line 1787, in _call_impl
[rank6]:     return forward_call(*args, **kwargs)
[rank6]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank6]:   File "<eval_with_key>.113", line 5, in forward
[rank6]:   File "xxxx/torch/_ops.py", line 1209, in __call__
[rank6]:     return self._op(*args, **kwargs)
[rank6]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
[rank6]:   File "xxxx/vllm/model_executor/layers/mamba/gdn_linear_attn.py", line 950, in gdn_attention_core
[rank6]:     self._forward_core(
[rank6]:   File "xxxx/vllm/model_executor/layers/mamba/gdn_linear_attn.py", line 680, in _forward_core
[rank6]:     self._warmup_prefill_kernels(mixed_qkv)
[rank6]:   File "xxxx/vllm/model_executor/layers/mamba/gdn_linear_attn.py", line 624, in _warmup_prefill_kernels
[rank6]:     g, beta = fused_gdn_gating(self.A_log, dummy_a, dummy_b, self.dt_bias)
[rank6]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank6]:   File "xxxx/vllm/model_executor/layers/mamba/gdn_linear_attn.py", line 1032, in fused_gdn_gating
[rank6]:     fused_gdn_gating_kernel[grid](
[rank6]:   File "xxxx/triton/runtime/jit.py", line 370, in <lambda>
[rank6]:     return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs)
[rank6]:                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank6]:   File "xxxx/triton/runtime/jit.py", line 744, in run
[rank6]:     kernel.run(grid_0, grid_1, grid_2, stream, kernel.function, kernel.packed_metadata, launch_metadata,
[rank6]:   File "xxxx/triton/backends/nvidia/driver.py", line 713, in __call__
[rank6]:     self.launch(gridX, gridY, gridZ, stream, function, self.launch_cooperative_grid, self.launch_pdl,
[rank6]: ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

(其它3个rank(共有4个)有这样的报错导致退出,略)

补充信息

  • 我把colocate改成server模式(但我仍然想使用colocate模式),其它不变,就能完全正常训练
  • 把训练的模型改成Qwen3-30B-Thinking-2507,也会报错,报的具体的错和上面的不一样(但AI的说法是这是“同一条 vLLM 多卡 colocate 初始化链路 不稳定的两种表现”)

lkdhy avatar Apr 25 '26 07:04 lkdhy

Can anyone provide a reproduction script? It runs normally on my end using the swift rlhf command.

add --vllm_tensor_parallel_size 4 \ use 4.1.2 images

yszhli avatar Apr 27 '26 02:04 yszhli

same error when training Qwen3-VL

HJYao00 avatar Apr 27 '26 04:04 HJYao00

ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

Could you try pip install git+https://github.com/hjh0119/swift.git@patch-vllm-triton and see if it fixes this issue?

hjh0119 avatar Apr 27 '26 09:04 hjh0119

ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

Could you try pip install git+https://github.com/hjh0119/swift.git@patch-vllm-triton and see if it fixes this issue?

我尝试在4.1.3的镜像中加入这里修改的代码

Image 运行的时候依然会有上面的问题

yszhli avatar Apr 27 '26 12:04 yszhli

ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

Could you try pip install git+https://github.com/hjh0119/swift.git@patch-vllm-triton and see if it fixes this issue?

好像还是不行。我直接在原环境中,执行pip install git+https://github.com/hjh0119/swift.git@patch-vllm-triton

随后同样的命令(上面有)重新运行训练,报的 ValueError 和之前一模一样(ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor)。

但是整个输出好像和之前不完全一样,具体如下:

先是非常多的 WARNING,均为:

INFO 04-28 14:51:25 [default_loader.py:384] Loading weights took 13.15 seconds INFO 04-28 14:51:26 [gpu_model_runner.py:4820] Model loading took 16.52 GiB memory and 14.801916 seconds INFO 04-28 14:51:26 [gpu_model_runner.py:5753] Encoder cache will be initialized with a budget of 16384 tokens, and profiled with 1 image items of the maximum feature size. INFO 04-28 14:51:31 [backends.py:1051] Using cache directory: /root/.cache/vllm/torch_compile_cache/ca151ff975/rank_0_0/backbone for vLLM's torch.compile INFO 04-28 14:51:31 [backends.py:1111] Dynamo bytecode transform time: 1.51 s INFO 04-28 14:51:31 [flashinfer_all_reduce.py:109] Auto-selected flashinfer allreduce backend: trtllm xxxx/torch/distributed/c10d_logger.py:83: UserWarning: barrier(): using the device under current context. You can specify device_id in init_process_group to mute this warning. return func(*args, **kwargs) INFO 04-28 14:51:33 [decorators.py:305] Directly load AOT compilation from path /root/.cache/vllm/torch_compile_cache/torch_aot_compile/0967cf192407b3a9adeb9b5cda113c085e2111f6544c3312bf9b3328a29e6c26/rank_4_0/model WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] GDN prefill kernel warmup (T=16) failed for layer language_model.model.layers.0.linear_attn. First inference may OOM due to autotuner. WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] Traceback (most recent call last): WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/vllm/model_executor/layers/mamba/gdn_linear_attn.py", line 636, in _warmup_prefill_kernels WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] self.chunk_gated_delta_rule( WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] return self._call_impl(*args, **kwargs) WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/torch/nn/modules/module.py", line 1787, in _call_impl WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] return forward_call(*args, **kwargs) WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/vllm/model_executor/custom_op.py", line 136, in forward WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] return self._forward_method(*args, **kwargs) WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/vllm/model_executor/layers/mamba/gdn_linear_attn.py", line 165, in forward_cuda WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] return fi_chunk_gated_delta_rule( WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] ^^^^^^^^^^^^^^^^^^^^^^^^^^ WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/vllm/model_executor/layers/mamba/gdn_linear_attn.py", line 79, in fi_chunk_gated_delta_rule WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] q = l2norm_fwd(q) WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] ^^^^^^^^^^^^^ WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/vllm/model_executor/layers/fla/ops/l2norm.py", line 117, in l2norm_fwd WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] l2norm_fwd_kernel2[(triton.cdiv(T, MBLOCK),)]( WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/triton/runtime/jit.py", line 370, in WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs) WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/triton/runtime/jit.py", line 744, in run WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] kernel.run(grid_0, grid_1, grid_2, stream, kernel.function, kernel.packed_metadata, launch_metadata, WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] File "xxxx/triton/backends/nvidia/driver.py", line 713, in call WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] self.launch(gridX, gridY, gridZ, stream, function, self.launch_cooperative_grid, self.launch_pdl, WARNING 04-28 14:51:33 [gdn_linear_attn.py:648] ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

(后面会重复这些WARNING,略)

这些 WARNING 之后就是 Traceback 报错输出,完整的如下:

[rank7]: Traceback (most recent call last): [rank7]: File "xxxx/swift/cli/_megatron/rlhf.py", line 7, in [rank7]: megatron_rlhf_main() [rank7]: File "xxxx/swift/megatron/pipelines/train/rlhf.py", line 73, in megatron_rlhf_main [rank7]: return MegatronRLHF(args).main() [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/swift/pipelines/base.py", line 52, in main [rank7]: result = self.run() [rank7]: ^^^^^^^^^^ [rank7]: File "xxxx/swift/megatron/pipelines/train/sft.py", line 70, in run [rank7]: trainer = self.prepare_trainer() [rank7]: ^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/swift/megatron/pipelines/train/rlhf.py", line 34, in prepare_trainer [rank7]: return trainer_cls(args, self.template, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/swift/megatron/trainers/grpo_trainer.py", line 61, in init [rank7]: self._init_rollout_engine() [rank7]: File "xxxx/swift/megatron/trainers/grpo_trainer.py", line 129, in _init_rollout_engine [rank7]: super()._init_rollout_engine() [rank7]: File "xxxx/swift/megatron/trainers/rollout_mixin.py", line 238, in _init_rollout_engine [rank7]: self.engine = self._prepare_vllm_engine() [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/swift/megatron/trainers/rollout_mixin.py", line 278, in _prepare_vllm_engine [rank7]: engine = GRPOVllmEngine( [rank7]: ^^^^^^^^^^^^^^^ [rank7]: File "xxxx/swift/infer_engine/vllm_engine.py", line 163, in init [rank7]: self._prepare_engine() [rank7]: File "xxxx/swift/infer_engine/vllm_engine.py", line 185, in _prepare_engine [rank7]: engine = llm_engine_cls.from_engine_args(self.engine_args) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/engine/llm_engine.py", line 177, in from_engine_args [rank7]: return cls( [rank7]: ^^^^ [rank7]: File "xxxx/vllm/v1/engine/llm_engine.py", line 111, in init [rank7]: self.engine_core = EngineCoreClient.make_client( [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/engine/core_client.py", line 103, in make_client [rank7]: return InprocClient(vllm_config, executor_class, log_stats) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/engine/core_client.py", line 285, in init [rank7]: self.engine_core = EngineCore(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/engine/core.py", line 124, in init [rank7]: kv_cache_config = self._initialize_kv_caches(vllm_config) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/tracing/otel.py", line 178, in sync_wrapper [rank7]: return func(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/engine/core.py", line 247, in _initialize_kv_caches [rank7]: available_gpu_memory = self.model_executor.determine_available_memory() [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/executor/uniproc_executor.py", line 184, in determine_available_memory [rank7]: memory = super().determine_available_memory() [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/executor/abstract.py", line 136, in determine_available_memory [rank7]: return self.collective_rpc("determine_available_memory") [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/executor/uniproc_executor.py", line 80, in collective_rpc [rank7]: result = run_method(self.driver_worker, method, args, kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/serial_utils.py", line 510, in run_method [rank7]: return func(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/torch/utils/_contextlib.py", line 124, in decorate_context [rank7]: return func(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/worker/gpu_worker.py", line 370, in determine_available_memory [rank7]: self.model_runner.profile_run() [rank7]: File "xxxx/vllm/v1/worker/gpu_model_runner.py", line 5789, in profile_run [rank7]: output = self._dummy_sampler_run(last_hidden_states) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/torch/utils/_contextlib.py", line 124, in decorate_context [rank7]: return func(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/worker/gpu_model_runner.py", line 5596, in _dummy_sampler_run [rank7]: sampler_output = self.sampler( [rank7]: ^^^^^^^^^^^^^ [rank7]: File "xxxx/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl [rank7]: return self._call_impl(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/torch/nn/modules/module.py", line 1787, in _call_impl [rank7]: return forward_call(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/sample/sampler.py", line 96, in forward [rank7]: sampled, processed_logprobs = self.sample(logits, sampling_metadata) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/sample/sampler.py", line 187, in sample [rank7]: random_sampled, processed_logprobs = self.topk_topp_sampler( [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/torch/nn/modules/module.py", line 1776, in _wrapped_call_impl [rank7]: return self._call_impl(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/torch/nn/modules/module.py", line 1787, in _call_impl [rank7]: return forward_call(*args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/sample/ops/topk_topp_sampler.py", line 106, in forward_native [rank7]: logits = apply_top_k_top_p(logits, k, p) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/sample/ops/topk_topp_sampler.py", line 252, in apply_top_k_top_p [rank7]: return apply_top_k_top_p_triton(logits, k, p) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/vllm/v1/sample/ops/topk_topp_triton.py", line 1035, in apply_top_k_top_p_triton [rank7]: _topk_topp_kernel[(NUM_PROGRAMS,)]( [rank7]: File "xxxx/triton/runtime/jit.py", line 370, in [rank7]: return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs) [rank7]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [rank7]: File "xxxx/triton/runtime/jit.py", line 744, in run [rank7]: kernel.run(grid_0, grid_1, grid_2, stream, kernel.function, kernel.packed_metadata, launch_metadata, [rank7]: File "xxxx/triton/backends/nvidia/driver.py", line 713, in call [rank7]: self.launch(gridX, gridY, gridZ, stream, function, self.launch_cooperative_grid, self.launch_pdl, [rank7]: ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)

lkdhy avatar Apr 28 '26 07:04 lkdhy

should be fixed in #9233

hjh0119 avatar Apr 28 '26 11:04 hjh0119