Skip to content

Commit d8b9802

Browse files
committed
Make inductor always run compile passes
basically, this is an annoying workaround for debugging iteratively. 1- you run the model, it compiles, but something weird happens 2- you enable some logging or tlparse, rerun. but inductor decides not to run your pass anymore, its results are cached. since (2) has confused me horribly on more than one occasion, i just disable caching for now
1 parent 40340a8 commit d8b9802

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

torchtitan/train.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ def __init__(self, job_config: JobConfig):
113113
gc_freq=job_config.training.gc_freq, debug=job_config.training.gc_debug
114114
)
115115

116+
# TODO(whc)
117+
# I do this becuase otherwise sometimes inductor will skip re-running passes like comms reordering
118+
torch._inductor.config.force_disable_caches=True
119+
116120
# allow configuring inductor comms optimizations from torchtitan commandline
117121
torch._inductor.config.reorder_for_compute_comm_overlap = (
118122
job_config.experimental.reorder_for_compute_comm_overlap

0 commit comments

Comments
 (0)