Skip to content

Commit d7d5365

Browse files
author
Mikhail Zolotukhin
committed
[TensorExpr] Hook Fuser Pass to JIT opt-limit utility.
That new feature allows to bisect the pass easily by hard-stopping it after a given number of hits. [ghstack-poisoned]
1 parent 5834438 commit d7d5365

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

torch/csrc/jit/passes/tensorexpr_fuser.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <torch/csrc/jit/codegen/fuser/interface.h>
66
#include <torch/csrc/jit/ir/alias_analysis.h>
77
#include <torch/csrc/jit/jit_log.h>
8+
#include <torch/csrc/jit/jit_opt_limit.h>
89
#include <torch/csrc/jit/passes/common_subexpression_elimination.h>
910
#include <torch/csrc/jit/passes/constant_pooling.h>
1011
#include <torch/csrc/jit/passes/dead_code_elimination.h>
@@ -975,6 +976,13 @@ class TensorExprFuser {
975976

976977
REQ(tensorexpr::isSupported(node));
977978
REQ(typesAreSupported(node));
979+
980+
// A hook to optimizations limitter to allow bisecting the pass
981+
auto allowed = JIT_OPT_LIMIT();
982+
if (!allowed) {
983+
return false;
984+
}
985+
978986
return true;
979987
}
980988

0 commit comments

Comments
 (0)