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
ox696c
ktransformers
Commits
9660b2cc
Unverified
Commit
9660b2cc
authored
Feb 26, 2025
by
Chen Hongtao
Committed by
GitHub
Feb 26, 2025
Browse files
Merge pull request #685 from vproxy-tools/main
fix numa cpu distribution
parents
e7ebb263
b2bff177
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
ktransformers/ktransformers_ext/cpu_backend/backend.cpp
ktransformers/ktransformers_ext/cpu_backend/backend.cpp
+6
-1
No files found.
ktransformers/ktransformers_ext/cpu_backend/backend.cpp
View file @
9660b2cc
...
...
@@ -54,7 +54,12 @@ void Backend::do_work_stealing_job(int task_num,
init_func_
=
init_func
;
compute_func_
=
compute_func
;
finalize_func_
=
finalize_func
;
#ifdef USE_NUMA
// numa node location will be calculated based on the number of threads
thread_num_
=
max_thread_num_
;
#else
thread_num_
=
std
::
min
(
max_thread_num_
,
task_num
);
#endif
int
base
=
task_num
/
thread_num_
;
int
remain
=
task_num
%
thread_num_
;
thread_state_
[
0
].
end
=
base
+
(
0
<
remain
);
...
...
@@ -146,4 +151,4 @@ void Backend::worker_thread(int thread_id) {
return
;
}
}
}
\ No newline at end of file
}
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