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

Fix excessive CPU memory consumption on TGI startup #595

Merged
merged 2 commits into from
May 16, 2024
Merged

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented May 15, 2024

What does this PR do?

When launching a TGI instance with a non-neuron model as parameter, the model needs to be exported from cached neuron artifacts during the container startup.

Before this change, the export was done without minimizing the CPU memory, which made it impossible to use this kind of "on-the-fly" export on the smaller ml.inf2.xlarge instances.

@dacorvo dacorvo marked this pull request as ready for review May 15, 2024 14:40
@@ -91,7 +91,7 @@ def fetch_model(
# Prefetch the neuron model from the Hub
logger.info(f"Fetching revision [{revision}] for neuron model {model_id} under {HF_HUB_CACHE}")
log_cache_size()
return snapshot_download(model_id, revision=revision)
return snapshot_download(model_id, revision=revision, ignore_patterns="*.bin")
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

@dacorvo dacorvo merged commit 7ad464d into main May 16, 2024
1 check passed
@dacorvo dacorvo deleted the launch_tgi_xlarge branch May 16, 2024 16:07
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.

2 participants