-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[https://nvbugs/6539941][fix] Preserve primary warmup error when batch cleanup also fails #17152
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2520,9 +2520,8 @@ def _release_batch_context(self, batch: Optional[ScheduledRequests], | |
| ResourceManagerType.CROSS_KV_CACHE_MANAGER) | ||
| spec_resource_manager = resource_manager.get_resource_manager( | ||
| ResourceManagerType.SPEC_RESOURCE_MANAGER) | ||
| try: | ||
| yield batch | ||
| finally: | ||
|
|
||
| def free_batch_resources() -> None: | ||
| if batch is not None and kv_cache_manager is not None: | ||
| for req in batch.all_requests(): | ||
| kv_cache_manager.free_resources(req) | ||
|
|
@@ -2533,6 +2532,24 @@ def _release_batch_context(self, batch: Optional[ScheduledRequests], | |
| if spec_resource_manager is not None: | ||
| spec_resource_manager.free_resources(req) | ||
|
|
||
| try: | ||
| yield batch | ||
| except BaseException: | ||
| # Freeing issues GPU work, so it raises again whenever the failure | ||
| # being unwound already left the CUDA context in a sticky error | ||
| # state. Letting that secondary error escape from a `finally` would | ||
| # *replace* the primary one, blaming the cache manager for a fault | ||
| # that actually happened in the model forward. | ||
| try: | ||
| free_batch_resources() | ||
| except Exception as e: # noqa: BLE001 | ||
|
Collaborator
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. Worth being aware this isn't purely diagnostic on the recoverable path. |
||
| logger.warning( | ||
| f"Failed to free warmup batch resources while unwinding: {e}" | ||
| ) | ||
| raise | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| else: | ||
| free_batch_resources() | ||
|
|
||
| def _get_num_extra_decoding_steps(self) -> int: | ||
| """Determines extra decoding steps needed for fused drafting loops.""" | ||
| if isinstance(self.model, BaseDraftingLoopWrapper): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,7 +183,6 @@ full:B300/accuracy/test_llm_api_pytorch.py::TestMiniMaxM3::test_nvfp4[use_msa=Fa | |
| full:B300/accuracy/test_llm_api_pytorch.py::TestMistralLarge3_675B::test_nvfp4_4gpus[latency_moe_trtllm] SKIP (https://nvbugs/6529874) | ||
|
Collaborator
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. This unwaives the B300 |
||
| full:B300/accuracy/test_llm_api_pytorch.py::TestNemotronV3Ultra::test_nvfp4_8gpus[attention_dp_off-trtllm] SKIP (https://nvbugs/6474894) | ||
| full:B300/accuracy/test_llm_api_pytorch.py::TestQwen3_30B_A3B::test_dummy_load_format SKIP (https://nvbugs/6525059) | ||
| full:B300/accuracy/test_llm_api_pytorch.py::TestStep3_7::test_fp8_block_scales[tp_size=4-ep_size=4-mtp_nextn=3] SKIP (https://nvbugs/6539941) | ||
| full:B300/llmapi/test_llm_api_pytorch_moe_lora.py::test_qwen_moe_routed_expert_multi_lora_varying_ranks[cudagraph] SKIP (https://nvbugs/6475623) | ||
| full:DGX_B200/accuracy/test_llm_api_pytorch.py::TestDeepSeekV4Pro::test_gsm8k_full_accuracy SKIP (https://nvbugs/6571418) | ||
| full:DGX_B200/disaggregated/test_disaggregated.py::test_disaggregated_gpt_oss_120b_harmony[gpt_oss/gpt-oss-120b] SKIP (https://nvbugs/6594241) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the outer handler is
except BaseExceptionbut the inner swallow isexcept Exception. ABaseException-derived cleanup failure (a nestedKeyboardInterrupt, or an assertion-freeSystemExitfrom a C-extension abort path) would still escape and replace the primary error — exactly the case this is meant to prevent. Making the inner oneexcept BaseExceptiontoo closes the gap for free.