[inductor][easy] print out exception message upon failing to write to a file (#114836)
To address Oleg's internal review feedback.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/114836
Approved by: https://github.com/khabinov
diff --git a/torch/_inductor/triton_heuristics.py b/torch/_inductor/triton_heuristics.py
index 213fe45..12538fb 100644
--- a/torch/_inductor/triton_heuristics.py
+++ b/torch/_inductor/triton_heuristics.py
@@ -629,7 +629,11 @@
file.write(bw_info_str + "\n")
file.write(f"{summary_str}\n\n")
except Exception as e:
- log.warning("failed to write profile bandwidth result into %s", output_file)
+ log.warning(
+ "failed to write profile bandwidth result into %s: %s",
+ output_file,
+ e,
+ )
class DebugAutotuner(CachingAutotuner):