Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ktransformers
Commits
7f57769c
Unverified
Commit
7f57769c
authored
Mar 14, 2025
by
Atream
Committed by
GitHub
Mar 14, 2025
Browse files
Merge pull request #852 from Lander-Hatsune/main
cpuinfer: filter repeated backend instantiation
parents
1c001b80
d166fb9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
ktransformers/operators/cpuinfer.py
ktransformers/operators/cpuinfer.py
+6
-1
No files found.
ktransformers/operators/cpuinfer.py
View file @
7f57769c
...
...
@@ -727,8 +727,13 @@ class CPUInferKVCache:
class
CPUInfer
:
cpuinfer
=
None
cur_backend_thread_num
=
0
def
__init__
(
self
,
thread_num
):
CPUInfer
.
cpuinfer
=
cpuinfer_ext
.
CPUInfer
(
thread_num
)
if
thread_num
>
CPUInfer
.
cur_backend_thread_num
:
CPUInfer
.
cur_backend_thread_num
=
thread_num
del
CPUInfer
.
cpuinfer
CPUInfer
.
cpuinfer
=
cpuinfer_ext
.
CPUInfer
(
thread_num
)
def
submit
(
self
,
task
):
CPUInfer
.
cpuinfer
.
submit
(
task
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment