Repository navigation
[graph_trainer] Add log_timer utility for tracing step timing - #3311
Merged
Merged
Conversation
SherlockNoMad
requested review from
aditvenk,
sanketpurandare,
tianyu-l,
xmfan and
yiming0416
as code owners
May 8, 2026 23:17
xmfan
approved these changes
May 9, 2026
Summary: Add a simple `log_timer` context manager to `common_utils.py` that logs wall-clock elapsed time to console. Apply it to `trace_train_step` in `GraphTrainer._make_fx_forward_backward_step` to measure tracing time. Test Plan: Existing unit tests pass. Timing output verified in training logs.
SherlockNoMad
force-pushed
the
bahuang/log-timer
branch
from
May 11, 2026 16:26
9a43a1d to
d66c1c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
log_timercontext manager tocommon_utils.pythat measures wall-clock elapsed time and logs it to console (e.g.trace_train_step took 0.043s).log_timerto thetrace_train_stepcall inGraphTrainer._make_fx_forward_backward_stepto measure tracing time.Test plan
log_timeroutput appears in training logs during aot_fx_trace runspytest torchtitan/experiments/graph_trainer/tests/ -x