Skip to content

Commit

Permalink
Fix enable_debug's handling of false value boolean env vars (#6040)
Browse files Browse the repository at this point in the history
Right now, running a Triton kernel with MLIR_ENABLE_DUMP=0 results in
the software pipeliner pass printing spurious output due to the
dumpIntermediateSteps flag that is set when MLIR_ENABLE_DUMP is neither
true nor a function value. This fix checks that the result of
isEnvValueBool's tri-state does in fact indicate that the value is not a
boolean before setting haveDump to true.
  • Loading branch information
plotfi authored Feb 27, 2025
1 parent 46e0778 commit 9f4c7fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/src/ir.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <optional>
#include <optional>
#include <pybind11/functional.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
Expand Down Expand Up @@ -1774,7 +1774,9 @@ void init_triton_ir(py::module &&m) {
std::string funcToDump;
if (!haveDump) {
funcToDump = triton::tools::getStrEnv("MLIR_ENABLE_DUMP");
if (!funcToDump.empty())
bool isEnvValueBool =
triton::tools::isEnvValueBool(funcToDump).has_value();
if (!funcToDump.empty() && !isEnvValueBool)
haveDump = true;
}
if (haveDump) {
Expand Down

0 comments on commit 9f4c7fc

Please sign in to comment.