mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #49] More Efficient Layer Distribution for DeepSeek Coder v2 on Multiple GPUs and CPUs #25
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#25
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 @BGFGB on GitHub (Aug 21, 2024).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/49
Hi, I'm currently trying to run DeepSeek Coder v2 on a single node with the following setup:
At present, with the default configuration, the model only fully utilizes a single GPU with 24GB of VRAM. Alternatively, it can be split across two GPUs, but only using around 12GB on each, which seems suboptimal given the available resources. Wouldn’t it be more efficient if I could fully utilize more GPUs?
I can modify the configuration to allocate more layers to the GPUs, but this has been a trial-and-error process. Is there a more systematic approach or calculation method that could help guide me in allocating layers more efficiently across the available GPUs? Are there any recommended strategies for balancing the model layers on GPUs with different VRAM capacities?
Any guidance on how to better utilize GPU resources for faster inference would be greatly appreciated.
Thanks!
@cts2021 commented on GitHub (Aug 22, 2024):
I have also encountered the same situation and will pay close attention.
@ELigoP commented on GitHub (Aug 22, 2024):
This is covered in https://github.com/kvcache-ai/ktransformers/issues/46 , tutorial is https://github.com/kvcache-ai/ktransformers/blob/main/doc/en/injection_tutorial.md
For now you need to write special .yaml optimization rule for your case.
@Azure-Tang commented on GitHub (Aug 22, 2024):
Are you looking for detailed guidance on how to write a YAML configuration that maximizes GPU utilization? We will consider it.
Before our detailed tutorial, a practical starting point is to assess the tensor sizes in your gguf files. For instance, by examining the DeepseekV2 configuration, you can determine the shapes and data types of the tensors and estimate the VRAM they require.
Note, there are two things you have to pay attention to when calculating:
@sammcj commented on GitHub (Aug 29, 2024):
This may not be quite right, but I'm thinking your config could look something like this:
2x A6000 GPUs (48GB each) and 192GB of RAM:
Node 2: Two 4090 GPUs (24GB each) and 64GB of RAM:
To keep the embedding tokens on the GPUs, I think you'd modify the configuration for the model.embed_tokens match. Instead of assigning it to the CPU, assign it to one of the GPUs, typically the first one (cuda:0). Here's how we can modify that part:
@ErvinXie commented on GitHub (Dec 11, 2025):
This issue has been automatically closed due to inactivity for 60 days.
If you believe this issue is still relevant, please feel free to reopen it with additional information or context.
Thank you for your contribution to KTransformers!
此 issue 因超过 60 天无活动而被自动关闭。
如果您认为此问题仍然存在,请随时重新打开并提供更多信息或上下文。
感谢您对 KTransformers 的贡献!