diff --git a/csrc/multidevice/utils.cpp b/csrc/multidevice/utils.cpp index 0c607881e0b..437ea1ba4ae 100644 --- a/csrc/multidevice/utils.cpp +++ b/csrc/multidevice/utils.cpp @@ -7,6 +7,8 @@ // clang-format on #include +#include +#include #include #include #include @@ -176,6 +178,8 @@ bool haveDifferentShardings( } bool isResharding(const Expr* expr) { + FUSER_PERF_SCOPE("isResharding"); + if (!ir_utils::isTvOp(expr)) { return false; } diff --git a/csrc/preseg_passes/optimization_pass.h b/csrc/preseg_passes/optimization_pass.h index 78a87a7e3ce..079e5015f44 100644 --- a/csrc/preseg_passes/optimization_pass.h +++ b/csrc/preseg_passes/optimization_pass.h @@ -8,6 +8,7 @@ #pragma once #include #include +#include #include #include #include @@ -51,13 +52,17 @@ class OptimizationPass { if (!flag_.load()) { return; } + + FUSER_PERF_SCOPE(DerivedClass::name().c_str()); DerivedClass::runPass(fusion); + // TODO: skip the logging of the pass where the fusion has not been changed. if (isDebugDumpEnabled(DebugDumpOption::PreSegmenterLogging)) { debug() << "Fusion after pass: " << DerivedClass::name() << std::endl; fusion->printMath(); debug() << "========================================" << std::endl; } + #ifndef NDEBUG // cycle detection is only enabled on debug run NVF_ERROR(