[BACKEND] Reduce code cleanup and bug fix for the fast path (#1816)

https://github.com/openai/triton/issues/1715
This commit is contained in:
Keren Zhou
2023-06-27 17:27:24 -07:00
committed by GitHub
parent 2dcbf4783e
commit d2de3f37f0
9 changed files with 81 additions and 31 deletions

View File

@@ -5,11 +5,15 @@
#include "mlir/IR/Matchers.h"
#include "triton/Dialect/Triton/IR/Dialect.h"
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
#include "triton/Tools/Sys/GetEnv.hpp"
#include <deque>
namespace mlir {
bool ReduceOpHelper::isFastReduction() {
// Disable fast reduction only for debugging purpose
if (::triton::tools::getBoolEnv("DISABLE_FAST_REDUCTION"))
return false;
return axis == triton::gpu::getOrder(getSrcLayout())[0];
}