mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[PR #852] [MERGED] cpuinfer: filter repeated backend instantiation #1501
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#1501
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/ktransformers/pull/852
Author: @Lander-Hatsune
Created: 3/10/2025
Status: ✅ Merged
Merged: 3/14/2025
Merged by: @Atream
Base:
main← Head:main📝 Commits (1)
d166fb9cpuinfer: filter repeated backend instantiation📊 Changes
1 file changed (+6 additions, -1 deletions)
View changed files
📝
ktransformers/operators/cpuinfer.py(+6 -1)📄 Description
Currently
CPUInferwill be instantiated twice as class(or static) attributes of the two CPU operator (KLinearCPUInferandKExpertsCPU), if both files are imported.Considering
__init__method of classCPUInfer, this repetition leads to multiple instantiation ofBackends (also the worker threads) andTaskQueues.This commit filters repeated
CPUInfer.__init__()s by maintaining a maximum number of threads requested.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.