mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #963] [Bug] Mixtral inference encounters error about tensor location #685
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#685
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 @pl752 on GitHub (Mar 23, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/963
Checklist
Describe the bug
Loading mixtral with default config works, but any message result in the following error
Reproduction
Model is https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF/blob/main/mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf
command is
ktransformers --model_path mistralai/Mixtral-8x7B-Instruct-v0.1 --gguf_path /home/pl752/mxtrl8b/ --optimize_config_path ktransformers/optimize/optimize_rules/Mixtral.yaml --web Trueconfig is default
Environment
Ubuntu 24.10, python 3.11, torch 2.8 nightly, cuda 12.8, rtx 3060m, ryzen 5800h, ktransformers latest (git main)
pip list
@qiyuxinlin commented on GitHub (Mar 24, 2025):
您好,我们已经很长时间没有试验过在 Mixtral 上是否能运行,并且这个报错看起来是因为权重和输入不在一个设备上导致的
@pl752 commented on GitHub (Mar 24, 2025):
Okay, then what should I do in the config or parameters, in order for it to end up in the proper positions?
@pl752 commented on GitHub (Mar 24, 2025):
And also, if I use local chat module instead of the ktransformers server module it just works.
@pl752 commented on GitHub (Mar 24, 2025):
It seems like input tokens end up on different devices on different backends somehow
@pl752 commented on GitHub (Mar 24, 2025):
I also have noticed that implementation of generation loop differs between server backend and local chat module, one passes input ids to model directrly, while other uses prefill_and_generate
and it seems to handle tokens differently
server
local_chat
@pl752 commented on GitHub (Mar 24, 2025):
Changing ktransformers/server/backend/interfaces/ktransformers.py from line 115
from
to
Seems to fix the problem. I think generation methods need some code unification.