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

Method EvalRatio

tensorflow/lite/experimental/ruy/tune.cc:79–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77} // namespace
78
79float TuningResolver::EvalRatio() {
80 // With the current settings, 400 iterations and 4 repeats, this test has
81 // a latency of roughly 80 microseconds on a Cortex-A53 at 1.4 GHz.
82 static constexpr int kLoopIters = 400;
83 static constexpr int kRepeats = 4;
84
85 Duration timing_poorly_ordered = Duration::max();
86 Duration timing_nicely_ordered = Duration::max();
87
88 for (int r = 0; r < kRepeats; r++) {
89 TimePoint t0 = Now();
90 PoorlyOrderedKernel(kLoopIters);
91 TimePoint t1 = Now();
92 NicelyOrderedKernel(kLoopIters);
93 TimePoint t2 = Now();
94 timing_poorly_ordered = std::min(timing_poorly_ordered, t1 - t0);
95 timing_nicely_ordered = std::min(timing_nicely_ordered, t2 - t1);
96 }
97
98 return ToFloatSeconds(timing_nicely_ordered) /
99 ToFloatSeconds(timing_poorly_ordered);
100}
101
102float TuningResolver::ThresholdRatio() {
103 // Empirically (see :tune_tool) determined threshold to distinguish in-order

Callers 1

QueryMethod · 0.80

Calls 6

NowFunction · 0.85
PoorlyOrderedKernelFunction · 0.85
NicelyOrderedKernelFunction · 0.85
ToFloatSecondsFunction · 0.85
maxFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected