[compile] Add compiled artifact counter for VLLM_USE_MEGA_AOT_ARTIFACT=1. (#37589)

Signed-off-by: zhxchen17 <zhxchen17@fb.com>
This commit is contained in:
Zhengxu Chen
2026-03-20 16:22:46 +00:00
committed by GitHub
parent 880be2b1b8
commit 2e089b96a8
2 changed files with 17 additions and 2 deletions
+3
View File
@@ -17,6 +17,7 @@ from torch.utils import _pytree as pytree
import vllm.envs as envs
from vllm.compilation.compiler_interface import get_inductor_factors
from vllm.compilation.counter import compilation_counter
from vllm.config import VllmConfig, get_current_vllm_config
from vllm.config.utils import hash_factors
from vllm.logger import init_logger
@@ -61,6 +62,7 @@ class StandaloneCompiledArtifacts:
self.submodule_bytes[f"{submod_name}_{shape}"] = hex_digest
if hex_digest not in self.submodule_bytes_store:
self.submodule_bytes_store[hex_digest] = entry
compilation_counter.num_compiled_artifacts_saved += 1
logger.debug(
"inserting new artifact for submod %s with shape %s "
"(%s bytes) at hash %s",
@@ -124,6 +126,7 @@ class StandaloneCompiledArtifacts:
def _load_entry(entry_bytes: bytes) -> AOTCompiledArtifact:
entry = pickle.loads(entry_bytes)
compilation_counter.num_compiled_artifacts_loaded += 1
return AOTCompiledArtifact.deserialize(entry)
with concurrent.futures.ThreadPoolExecutor() as executor: