You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/11/15 11:42:00 UTC

[GitHub] [tvm] d-smirnov commented on a diff in pull request #13369: [usmp] Hill Climb greedy layout size check relaxed

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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org