Skip to content
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

Reduce memory usage #148

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Reduce memory usage #148

wants to merge 2 commits into from

Conversation

seanses
Copy link
Collaborator

@seanses seanses commented Jan 23, 2025

Client memory footprint on file upload has been high due to several locations of inefficiency. This fixes some of those:

  • Reduce disk read queue size.
  • Limit upload concurrency to hardware parallelism (# of cores).
  • Drop large buffer preemptively before "slow" network transmission.

Context:
Before the above changes the theoretical memory usage is:

image

This PR reduces the memory usage to the below without compromising speed (benchmarked with same settings as in https://www.notion.so/huggingface2/Xorb-upload-speed-1531384ebcac8012bf74fa08ed822f67):

image

There is still ~650 MiB extra memory footprint demanding further investigation. The 512 MiB global Xorb uploader memory footprint can also be significantly reduced, but that requires more work in the future.

@seanses seanses requested review from port8080 and hoytak January 23, 2025 01:21
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.

1 participant