Bugfix: -t thread count ignored in correct_round1 #13
Open
qiyuanhuakai wants to merge 1 commit intoLuoGroup2023:masterfrom
Open
Bugfix: -t thread count ignored in correct_round1 #13qiyuanhuakai wants to merge 1 commit intoLuoGroup2023:masterfrom
qiyuanhuakai wants to merge 1 commit intoLuoGroup2023:masterfrom
Conversation
Fixed:When users specify the thread count via -t, the correct_round1 stage does not honor the user-provided value while generating recorrected.fa. Instead, it uses all available CPU cores, making the thread setting ineffective. 修复:当用户通过 -t指定线程数时,correct_round1 阶段在生成/写入 recorrected.fa 的过程中没有按用户设置的线程数运行,而是会占用机器所有可用 CPU 核心,导致线程参数实际失效。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 概述
correct_round1ignores the user-specified-tvalue when generatingrecorrected.faand uses all available CPU cores.correct_round1在生成recorrected.fa时没有使用用户通过-t指定的线程数,而是占用所有可用 CPU 核心。Reproduction / 复现方式
Run DeChat with
-t 16Check CPU usage during the first polish stage (
correct_round1)It uses all cores instead of 16 threads
使用
-t 16运行 DeChat观察第一次 polish(
correct_round1)阶段的 CPU 使用情况实际会使用全部核心,而不是 16 线程
Root cause / 原因
Dispatcher(threads)uses a globalthreads(default0), and0means "use all cores" in GATB Dispatcher.chat_opt->thread_numwas not applied.Dispatcher(threads)实际使用了全局threads(默认0),而0在 GATB Dispatcher 中表示“自动使用全部核心”。chat_opt->thread_num没有被用于设置线程数。Fix / 修复
Define a local
threadsincorrect_round1(chat_opt_t *chat_opt)and set it tochat_opt->thread_num, soDispatcherrespects-t/.在
correct_round1(chat_opt_t *chat_opt)内新增局部变量threads = chat_opt->thread_num,使Dispatcher按-t运行。After fix / 修复后