d-smirnov commented on code in PR #13369:
URL: https://github.com/apache/tvm/pull/13369#discussion_r1022686177
##########
src/tir/usmp/algo/hill_climb.cc:
##########
@@ -312,6 +331,14 @@ class HillClimbAllocator : public GreedyBase {
Map<BufferInfo, PoolAllocation> result;
// return winning combination
for (auto it : result_pool_allocations) {
+ // post-check that everything was fit
+ const BufferInfoNode* buf = it.first;
+ const PoolAllocation& pa = it.second;
+ if (NullValue<PoolInfo>().same_as(pa->pool_info) ||
+ !IsValidPlacement(pa->pool_info, pa->byte_offset->value,
buf->size_bytes->value)) {
+ std::unordered_map<PoolInfo, size_t, ObjectPtrHash, ObjectPtrEqual> m
= {};
+ SelectPlacementPool(GetRef<BufferInfo>(buf), m);
Review Comment:
The "optimistic" estimation can be calculated from current error message as
sum of `size_bytes` (buffer size) and `size_hint_bytes` (pool size)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]