-
Notifications
You must be signed in to change notification settings - Fork 13.9k
common : throttle download progress output to reduce IO flush #17427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common : throttle download progress output to reduce IO flush #17427
Conversation
This change limits progress updates to approximately every 0.1% of the file size to minimize stdio overhead. Also fixes compiler warnings regarding __func__ in lambdas. Signed-off-by: Adrien Gallouët <angt@huggingface.co>
5e49b30 to
3fc9f54
Compare
|
By any chance, do you have merge permissions? Otherwise I can help to merge this PR |
|
|
||
| std::atomic<size_t> downloaded{existing_size}; | ||
| const char * func = __func__; // avoid __func__ inside a lambda | ||
| size_t downloaded = existing_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason that this was std::atomic<size_t> before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea, maybe to be safer than needed. I noticed it was useless when adding progress_step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is OK to merge if you confirm that the atomic was not important here.
We can re-implement it once we move the progress tracking to a higher scope though (i.e. shared among threads). This will be important once we implement the model download function in llama-server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes absolutely useless
Thanks @taronaeo, I don't have merge permissions, but I’m not sure I've fully convinced @ggerganov about the atomic yet 😂 |
This change limits progress updates to approximately every 0.1% of the file size to minimize stdio overhead.
Also fixes compiler warnings regarding
__func__in lambdas.