Skip to content

Conversation

@Aadeshveer
Copy link
Contributor

@Aadeshveer Aadeshveer commented Dec 22, 2025

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

Copy link
Collaborator

@ngxson ngxson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use log_flush instead

@Aadeshveer
Copy link
Contributor Author

changed common_log_pause to common_log_flush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: llama-fit-params output is racy when model fits into VRAM

2 participants