[BugFix] Correct OTEL span start time for Dynamo compilation (#40698)
Signed-off-by: emricksini-h <emrick.birivoutin@hcompany.ai> Co-authored-by: Simon Mo <simon.mo@hey.com>
This commit is contained in:
@@ -1144,16 +1144,19 @@ class VllmBackend:
|
|||||||
compilation_counter.num_graphs_seen += 1
|
compilation_counter.num_graphs_seen += 1
|
||||||
from .monitor import torch_compile_start_time
|
from .monitor import torch_compile_start_time
|
||||||
|
|
||||||
dynamo_time = time.perf_counter() - torch_compile_start_time
|
current_perf = time.perf_counter()
|
||||||
|
current_epoch = time.time()
|
||||||
|
dynamo_time = current_perf - torch_compile_start_time
|
||||||
logger.info_once(
|
logger.info_once(
|
||||||
"Dynamo bytecode transform time: %.2f s",
|
"Dynamo bytecode transform time: %.2f s",
|
||||||
dynamo_time,
|
dynamo_time,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Record Dynamo time in tracing if available
|
# Record Dynamo time in tracing if available
|
||||||
start_time = int(torch_compile_start_time * 1e9)
|
real_start_time = current_epoch - dynamo_time
|
||||||
|
start_time_ns = int(real_start_time * 1e9)
|
||||||
attributes = {"dynamo.time_seconds": dynamo_time}
|
attributes = {"dynamo.time_seconds": dynamo_time}
|
||||||
instrument_manual("Dynamo bytecode transform", start_time, None, attributes)
|
instrument_manual("Dynamo bytecode transform", start_time_ns, None, attributes)
|
||||||
|
|
||||||
# we control the compilation process, each instance can only be
|
# we control the compilation process, each instance can only be
|
||||||
# called once
|
# called once
|
||||||
|
|||||||
Reference in New Issue
Block a user