[CI] Reject out-of-vocabulary before they reach the GPU logprob path (#44042)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
Andreas Karatzas
2026-06-02 22:27:52 -05:00
committed by GitHub
parent 7b476c8f14
commit 53b88d1dfc
4 changed files with 82 additions and 9 deletions
+10
View File
@@ -6278,11 +6278,21 @@ class GPUModelRunner(
# Calls torch.accelerator.synchronize()
self._cleanup_profiling_kv_cache()
if current_platform.is_rocm():
# Drop captured graphs before distributed teardown. On ROCm, delayed
# graph destruction can surface HSA faults in the next engine startup.
CUDAGraphWrapper.clear_all_graphs()
BreakableCUDAGraphWrapper.clear_all_graphs()
self.encoder_cudagraph_manager = None
self.compilation_config.static_forward_context.clear()
self.model = None # type: ignore[assignment]
_ROPE_DICT.clear()
reset_workspace_manager()
if current_platform.is_rocm():
gc.collect()
torch.accelerator.empty_cache()
torch.accelerator.synchronize()
def _cleanup_profiling_kv_cache(self) -> None:
torch.accelerator.synchronize()