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
d166fb9f
Commit
d166fb9f
authored
Mar 10, 2025
by
Lander-Hatsune
Browse files
cpuinfer: filter repeated backend instantiation
parent
09c043d8
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 @
d166fb9f
...
...
@@ -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