Repository navigation
[None][fix] respect KV cache quotas and ignore constraint for non-GPU tiers #18014
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
Closed
jiaganc
wants to merge
8
commits into
NVIDIA:main
from
jiaganc:codex/remove-host-tier-quota-constraint
Closed
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d8a0188
[None][fix] respect configured KV cache tier quotas
jiaganc 53c2fa1
[None][fix] handle zero GPU cache quota
jiaganc c653b24
[None][chore] format zero quota test
jiaganc 034ed45
[None][test] parameterize insufficient GPU quotas
jiaganc 824b654
Revert "[None][test] parameterize insufficient GPU quotas"
jiaganc e43df63
[None][test] separate zero GPU quota coverage
jiaganc 3a3bd5e
[None][chore] format split quota tests
jiaganc c8dadec
[None][chore] address quota review feedback
jiaganc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
| supports_native_fp8_lora) | ||
| from tensorrt_llm.logger import logger | ||
| from tensorrt_llm.mapping import CpType, Mapping | ||
| from tensorrt_llm.runtime.kv_cache_manager_v2 import InsufficientQuotaError | ||
|
|
||
| from ..attention_backend import get_sparse_attn_kv_cache_manager | ||
| from ..hostfunc import set_low_latency_dispatch | ||
|
|
@@ -2004,6 +2005,22 @@ def build_managers(self, | |
| resources: Dict, | ||
| estimating_kv_cache: bool = False) -> None: | ||
| """Construct KV caches for model and draft model (if applicable).""" | ||
| try: | ||
| self._build_managers(resources, estimating_kv_cache) | ||
| except InsufficientQuotaError as error: | ||
| guidance = ( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While we are there, can we read the |
||
| "For the GPU tier, increase kv_cache_config.max_gpu_total_bytes " | ||
| "(if set) or kv_cache_config.free_gpu_memory_fraction, or decrease " | ||
| "max_batch_size, max_seq_len, or max_num_tokens; for the host/CPU " | ||
| "tier, increase kv_cache_config.host_cache_size; for the disk tier, " | ||
| "increase kv_cache_config.disk_cache_size.") | ||
| raise ValueError( | ||
| f"Failed to create KV cache manager: {error}. {guidance}" | ||
| ) from error | ||
|
|
||
| def _build_managers(self, | ||
| resources: Dict, | ||
| estimating_kv_cache: bool = False) -> None: | ||
| if self._skip_est: | ||
| self.configure_kv_cache_capacity() | ||
| original_max_seq_len = self._max_seq_len | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.