Skip to content

UPSTREAM PR #18276: tools : use common_log_pause to fix fit-params output race#659

Closed
loci-dev wants to merge 1 commit intomainfrom
upstream-PR18276-branch_Aadeshveer-fix-fit-params-race
Closed

UPSTREAM PR #18276: tools : use common_log_pause to fix fit-params output race#659
loci-dev wants to merge 1 commit intomainfrom
upstream-PR18276-branch_Aadeshveer-fix-fit-params-race

Conversation

@loci-dev
Copy link
Copy Markdown

Mirrored from ggml-org/llama.cpp#18276

Replaced the std::this_thread::sleep_for(10ms) hack with common_log_pause(common_log_main()) in llama-fit-params.

Reasoning:
The previous 10ms delay was intended to let the async logger drain its queue to stderr before the main thread printed the result to stdout. However, on high-performance or loaded systems, 10ms is not guaranteed to be enough, leading to interleaved output (see Issue #18085).

common_log_pause explicitly waits for the background worker to drain the log queue, ensuring deterministic separation between logs and the final result.

Fixes #18085

@loci-dev loci-dev force-pushed the main branch 4 times, most recently from 26a6f0f to cf53bc9 Compare December 22, 2025 14:09
@DajanaV DajanaV closed this Dec 22, 2025
@DajanaV DajanaV deleted the upstream-PR18276-branch_Aadeshveer-fix-fit-params-race branch December 22, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants