MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / IsMegamorphic

Function IsMegamorphic

tensorflow/compiler/jit/xla_compilation_cache.cc:189–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189static bool IsMegamorphic(
190 int64 compile_count,
191 int64 execution_count,
192 uint64 max_compile_time_s) {
193 const int64 kCompileThreshold = 10;
194 const int64 kMinExecutionsPerCompile = 50;
195 const uint64 kMaxCompileTimeThreshold = 30;
196
197 // This heuristic is trying to capture the following property: have we sunk a
198 // certain minimum amount of compile time into the cluster that didn't quite
199 // "pay off"?
200 return (compile_count > kCompileThreshold &&
201 execution_count < kMinExecutionsPerCompile * compile_count) ||
202 max_compile_time_s > kMaxCompileTimeThreshold;
203}
204
205Status XlaCompilationCache::CompileSingleOp(
206 const XlaCompiler::Options& options,

Callers 1

CompileImplMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected