[torch.compile] add dynamo time tracking (#11005)

Signed-off-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
youkaichao
2024-12-08 23:09:04 -08:00
committed by GitHub
parent af7c4a92e6
commit d1c2e15eb3
3 changed files with 16 additions and 5 deletions
+6
View File
@@ -265,7 +265,13 @@ class VllmBackend:
def __call__(self, graph: fx.GraphModule, example_inputs) -> Callable:
# when dynamo calls the backend, it means the bytecode
# transform and analysis are done
compilation_counter.num_graphs_seen += 1
from .monitor import torch_compile_start_time
dynamo_time = time.time() - torch_compile_start_time
logger.info("Dynamo bytecode transform time: %.2f s", dynamo_time)
self.compilation_configs.compilation_time += dynamo_time
# we control the compilation process, each instance can only be
# called once