Skip to content

Commit c71c421

Browse files
committed
Address review comments
Change-Id: Iff5f1effa08e0628de91f5577487d0cecebec824
1 parent 52edffa commit c71c421

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

python/tvm/contrib/ethosu/cascader/propagator.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ def __init__(self, transform, offset):
3434
def propagate(self, stripe_config):
3535
return _ffi_api.PropagatorPropagate(self, stripe_config)
3636

37-
def benchmark_propagate(self, stripe_config, repeats):
38-
return _ffi_api.PropagatorPropagateBenchmark(self, stripe_config, repeats)
39-
4037
@property
4138
def transform(self):
4239
"""Get the transform matrix"""

src/contrib/ethosu/cascader/propagator.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ TVM_REGISTER_GLOBAL("contrib.ethosu.cascader.PropagatorPropagate")
116116
return propagator->propagate(stripe_config);
117117
});
118118

119-
TVM_REGISTER_GLOBAL("contrib.ethosu.cascader.PropagatorPropagateBenchmark")
120-
.set_body_typed([](Propagator propagator, StripeConfig stripe_config, int repeats) {
121-
for (int i = 0; i < repeats; i++) {
122-
propagator->propagate(stripe_config);
123-
}
124-
return propagator->propagate(stripe_config);
125-
});
126-
127119
TVM_REGISTER_NODE_TYPE(PropagatorNode);
128120

129121
} // namespace cascader

src/contrib/ethosu/cascader/stripe_config.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,22 @@ class StripeConfig : public ObjectRef {
167167
* \param enable_sliding_window Whether to assume the sliding window optimization.
168168
* \return A map between stripe shapes and the number of stripes of that shape that need
169169
* executing.
170+
* \note If the StripeConfig were to split an (8, 8) tensor into (4, 4) stripes with
171+
* (4, 4) striding, then this function will return {(4, 4): 4} indicating that 4 (4, 4)
172+
* stripes will be executed. If instead an (8, 8) were striped using (5, 5) stripes
173+
* with (5, 5) striding, this function would return:
174+
*
175+
* {
176+
* (5, 5): 1,
177+
* (3, 5): 1,
178+
* (5, 3): 1,
179+
* (3, 3): 1,
180+
* }
181+
*
182+
* This is because some of the stripes will exceed the extent of the tensor and so only part
183+
* of them will need executing. Therefore, CountStripes will return the exact number of each
184+
* shape of stripe that is executed, accounting for edge and overlap behaviour which is not
185+
* explicit in the StripeConfig alone.
170186
*/
171187
std::map<std::vector<int>, int> CountStripes(const StripeConfig& stripe_config,
172188
bool enable_sliding_window);

0 commit comments

Comments
 (0)