Retrieve the correct cached model batch size in Neuron config checker for Neuron Backend #3300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Neuron config checker will look at each of the cached models to find any that meet the specified criteria. Specifically, they will DROP for anything with:
Any tp_degree greater than specified:
text-generation-inference/backends/neuron/server/text_generation_server/tgi_env.py
Line 167 in 24c2bff
(leaving anything < or =)
A batch size LESS THAN what was specified:
text-generation-inference/backends/neuron/server/text_generation_server/tgi_env.py
Line 185 in 24c2bff
(leaving anything > or =)
It then sorts anything that that isn't dropped LARGEST to smallest (on both batch size and tp):
text-generation-inference/backends/neuron/server/text_generation_server/tgi_env.py
Line 115 in 24c2bff
Then, it selects the top one on the list to use:
text-generation-inference/backends/neuron/server/text_generation_server/tgi_env.py
Line 153 in 24c2bff
This works great for tp_degree, where you (probably) don't want to run a tp=2 model on a system with 8 cores. But if you specify a batch size of 4, you probably want a batch size of 4, not one of 8.
What does this PR do?
It changes the sort order for batch size so that the smallest valid batch will be first. Since we are looking for something not <, the SMALLEST thing on that list is >= .
No new tests because it should be covered by existing tests.
Fixes # (issue)
Fixing #3299
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.