Skip to content

Commit

Permalink
[PT2D] Fix the circular import issue (#125618)
Browse files Browse the repository at this point in the history
As title

Differential Revision: [D57011394](https://our.internmc.facebook.com/intern/diff/D57011394/)

Pull Request resolved: #125618
Approved by: https://github.com/wz337
  • Loading branch information
fegin authored and pytorchmergebot committed May 7, 2024
1 parent acafaba commit e72936c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torch/distributed/distributed_c10d.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,8 @@ def init_process_group(
#
# Since this API must be called before all distributed code being compiled,
# clearing the cache here should be safe.
torch._dynamo.trace_rules.clear_lru_cache()
if "torch._dynamo" in sys.modules:
torch._dynamo.trace_rules.clear_lru_cache()

assert (store is None) or (
init_method is None
Expand Down

0 comments on commit e72936c

Please sign in to comment.