Skip to content

Commit 72453a6

Browse files
xuanzhang816pytorchmergebot
authored andcommitted
[PT2][comms] put visualize_overlap in a try-except block (pytorch#155222)
Summary: For simple FSDP, this `visualize_overlap` function is throwing errors. Seems to be a mistake here since `visualize_overlap` is called twice here and one is in try-except and one is not, so doing the same for both places. Test Plan: :) Rollback Plan: Reviewed By: Microve Bifferential Revision: D75985733 Pull Request resolved: pytorch#155222 Approved by: https://github.com/yf225
1 parent 9bae2fc commit 72453a6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

torch/_inductor/comms.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,10 @@ def reorder_compute_and_comm_for_overlap(
531531
overlap_log.debug(
532532
f"==== Visualize overlap before reordering pass {p}, {peak_memory=} ====" # noqa: G004
533533
)
534-
visualize_overlap(order)
534+
try:
535+
visualize_overlap(order)
536+
except Exception as e:
537+
overlap_log.debug("", exc_info=e)
535538
t0 = time.time()
536539
order = p(order) # type: ignore[operator]
537540
t = time.time() - t0
@@ -542,7 +545,7 @@ def reorder_compute_and_comm_for_overlap(
542545
try:
543546
visualize_overlap(order)
544547
except Exception as e:
545-
overlap_log.debug(str(e))
548+
overlap_log.debug("", exc_info=e)
546549
peak_memory, _ = estimate_peak_memory(
547550
snodes, get_freeable_input_buf(snodes, graph_inputs), graph_outputs
548551
)

0 commit comments

Comments
 (0)