mirror of
https://github.com/deepseek-ai/Janus.git
synced 2026-11-05 00:57:18 +00:00
[GH-ISSUE #187] 有使用纯CPU跑的吗,各种多线程开启但是服务只使用了一个物理CPU核心,研究了很长时间不知道为啥 #149
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/Janus#149
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 @bugwang on GitHub (Feb 26, 2025).
Original GitHub issue: https://github.com/deepseek-ai/Janus/issues/187
os.environ["OMP_NUM_THREADS"] = "32" # 例如设置为1
os.environ["MKL_NUM_THREADS"] = "32" # 例如设置为1
os.environ["OPENBLAS_NUM_THREADS"] = "32"
os.environ["VECLIB_MAXIMUM_THREADS"] = "32"
os.environ["NUMEXPR_NUM_THREADS"] = "32"
print("get_num_threads ",torch.get_num_threads())
torch.set_num_threads(32)
物理核心32个,只用一个核心 100%
搞了三天了、没查到问题。
@bugwang commented on GitHub (Feb 26, 2025):
如果只是Python GIL限制。无法改变,也只能放弃了