[Compile][CI] Honor Triton cache overrides and add AMD timeout headroom (#58474)

Signed-off-by: Andreas Karatzas <andreas.karatzas@protonmail.com> Co-authored-by: Codex <noreply@openai.com>

Andreas Karatzas committed Sep 24, 2026 at 01:27 UTC 153f2ba1b986fb461d84ae7b4f9644a608f36bc8
4 files changed +18 -7
.buildkite/test-amd.yaml
+1 -1
@@ -1995,7 +1995,7 @@ steps:
1995 #------------------------------------------------------ mi300 · model_executor -------------------------------------------------------#
1996
1997 - label: ":amd: (MI300) Model Executor" # TBD
1998 - timeout_in_minutes: 60
1998 + timeout_in_minutes: 75
1999 mirror_hardwares: [amdexperimental, amdproduction, amdgfx942nightly, amdmi300]
2000 dind: false
2001 agent_pool: mi300_1
.buildkite/test_areas/model_executor.yaml
+1 -1
@@ -33,7 +33,7 @@ steps:
33 label: ":amd: (MI300) Model Executor"
34 dind: false
35 device: mi300_1
36 - timeout_in_minutes: 60
36 + timeout_in_minutes: 75
37 depends_on:
38 - image-build-amd
39 source_file_dependencies:
docs/design/torch_compile.md
+6
@@ -27,6 +27,12 @@ With all these factors taken into consideration, usually we can guarantee that t
27
28 A unique aspect of vLLM's `torch.compile` integration, is that we guarantee all the compilation finishes before we serve any requests. No requests will trigger new compilations. Otherwise, the engine would be blocked on that request, and the response time will have unexpected spikes.
29
30 +An explicit `TRITON_CACHE_DIR` is preserved, allowing processes and model
31 +configurations to reuse Triton artifacts. The directory can start empty: the
32 +first compilation populates it and later matching specializations reuse it.
33 +When copying compilation caches, also copy this directory if set. Cold-cache
34 +tests should set it to a fresh directory.
35 +
36 By default, the cache saves compiled artifacts as binary files. If you would like to interact with the generated code for debugging purposes, set the field `compile_cache_save_format=unpacked` in the compilation config, or omit this and set the env variable `VLLM_COMPILE_CACHE_SAVE_FORMAT=unpacked`.
37
38 ## Dynamic shapes and vllm guard dropping
vllm/compilation/compiler_interface.py
+10 -5
@@ -23,6 +23,8 @@ from vllm.utils.torch_utils import is_torch_equal_or_newer
23
24 logger = init_logger(__name__)
25
26 +_last_inductor_triton_cache_dir: str | None = None
27 +
28
29 class CompilerInterface:
30 """The interface for a compiler that can be used by vLLM."""
@@ -453,19 +455,22 @@ class InductorAdaptor(CompilerInterface):
455 def initialize_cache(
456 self, cache_dir: str, disable_cache: bool = False, prefix: str = ""
457 ) -> None:
458 + global _last_inductor_triton_cache_dir
459 self.cache_dir = cache_dir
460 self.prefix = prefix
461 self.base_cache_dir = cache_dir[: -len(prefix)] if prefix else cache_dir
462 if disable_cache:
463 return
461 - # redirect the cache directory to a subdirectory
462 - # set flags so that Inductor and Triton store their cache
463 - # in the cache_dir, then users only need to copy the cache_dir
464 - # to another machine to reuse the cache.
464 + # Keep artifacts together unless the caller supplies a Triton cache.
465 inductor_cache = os.path.join(self.base_cache_dir, "inductor_cache")
466 os.makedirs(inductor_cache, exist_ok=True)
467 os.environ["TORCHINDUCTOR_CACHE_DIR"] = inductor_cache
468 - triton_cache = os.path.join(self.base_cache_dir, "triton_cache")
468 + triton_cache = os.environ.get("TRITON_CACHE_DIR")
469 + # A directory assigned by an earlier adaptor is still a model-local
470 + # default, rather than a caller override for subsequent models.
471 + if triton_cache is None or triton_cache == _last_inductor_triton_cache_dir:
472 + triton_cache = os.path.join(self.base_cache_dir, "triton_cache")
473 + _last_inductor_triton_cache_dir = triton_cache
474 os.makedirs(triton_cache, exist_ok=True)
475 os.environ["TRITON_CACHE_DIR"] = triton_cache
476