Skip to content

Conversation

@angt
Copy link
Collaborator

@angt angt commented Nov 21, 2025

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.

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>
@angt angt force-pushed the common-throttle-download-progress-output-to-reduce-io-flush branch from 5e49b30 to 3fc9f54 Compare November 28, 2025 14:43
@taronaeo
Copy link
Collaborator

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;
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes absolutely useless

@angt
Copy link
Collaborator Author

angt commented Nov 29, 2025

By any chance, do you have merge permissions? Otherwise I can help to merge this PR

Thanks @taronaeo, I don't have merge permissions, but I’m not sure I've fully convinced @ggerganov about the atomic yet 😂

@ggerganov ggerganov merged commit beb1f0c into ggml-org:master Nov 30, 2025
72 of 74 checks passed
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.

4 participants