mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1338] [Bug] #898
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#898
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @withyou971 on GitHub (May 26, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1338
检查清单
问题描述
python ktransformers/local_chat.py --architectures Qwen3MoeForCausalLM --model_path /mnt/model/Qwen3-30B-A3B --gguf_path /mnt/model/Qwen3-30B-A3B --backend_type balance_serve --optimize_config_path ktransformers/optimize/optimize_rules/Qwen3Moe-serve.yaml
loading model.layers.47.input_layernorm.weight to cuda
loading model.layers.47.post_attention_layernorm.weight to cuda
loading model.norm.weight to cuda
Getting inference context from sched_client.
sched_rpc started with PID: 186
Got inference context, sending it to subscribers.
Rebuilding kvcache
Process SpawnProcess-1:
Traceback (most recent call last):
File "/opt/conda/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/conda/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 277, in run_engine
engine = Engine(args, token_queue, broadcast_endpoint, kvcache_event)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 192, in init
inference_context = self.sched_client.rebuild_inferece_context(inference_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/balance_serve/sched_rpc.py", line 196, in rebuild_inferece_context
inference_context.k_cache = [fn(*args) for fn,args in data['k_cache']]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/balance_serve/sched_rpc.py", line 196, in
inference_context.k_cache = [fn(*args) for fn,args in data['k_cache']]
^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/torch/multiprocessing/reductions.py", line 181, in rebuild_cuda_tensor
storage = storage_cls._new_shared_cuda(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/torch/storage.py", line 1434, in _new_shared_cuda
return torch.UntypedStorage._new_shared_cuda(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: invalid resource handle
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with
TORCH_USE_CUDA_DSAto enable device-side assertions.复现步骤
python ktransformers/local_chat.py --architectures Qwen3MoeForCausalLM --model_path /mnt/model/Qwen3-30B-A3B --gguf_path /mnt/model/Qwen3-30B-A3B --backend_type balance_serve --optimize_config_path ktransformers/optimize/optimize_rules/Qwen3Moe-serve.yaml
环境信息
windows wsl ubtunu 2204 3090*1
使用镜像approachingai/ktransformers:v0.3.1-AVX2
@withyou971 commented on GitHub (May 26, 2025):
不使用镜像会卡在loading blk.44.attn_k_norm.weight to cuda
loading blk.44.attn_norm.weight to cuda
loading blk.44.ffn_norm.weight to cuda
loading blk.45.attn_q_norm.weight to cuda
loading blk.45.attn_k_norm.weight to cuda
loading blk.45.attn_norm.weight to cuda
loading blk.45.ffn_norm.weight to cuda
loading blk.46.attn_q_norm.weight to cuda
loading blk.46.attn_k_norm.weight to cuda
loading blk.46.attn_norm.weight to cuda
loading blk.46.ffn_norm.weight to cuda
loading blk.47.attn_q_norm.weight to cuda
loading blk.47.attn_k_norm.weight to cuda
loading blk.47.attn_norm.weight to cuda
loading blk.47.ffn_norm.weight to cuda
loading output_norm.weight to cuda
Getting inference context from sched_client.
sched_rpc started with PID: 65096
Got inference context, sending it to subscribers.
Rebuilding kvcache
48
kv_cache loaded successfully.