{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/tvm/issues/942","repository_url":"https://api.github.com/repos/dmlc/tvm","labels_url":"https://api.github.com/repos/dmlc/tvm/issues/942/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/tvm/issues/942/comments","events_url":"https://api.github.com/repos/dmlc/tvm/issues/942/events","html_url":"https://github.com/dmlc/tvm/pull/942","id":301043042,"number":942,"title":"[PASS] enable small vars reuse big buffer","user":{"login":"xqdan","id":23742050,"avatar_url":"https://avatars1.githubusercontent.com/u/23742050?v=4","gravatar_id":"","url":"https://api.github.com/users/xqdan","html_url":"https://github.com/xqdan","followers_url":"https://api.github.com/users/xqdan/followers","following_url":"https://api.github.com/users/xqdan/following{/other_user}","gists_url":"https://api.github.com/users/xqdan/gists{/gist_id}","starred_url":"https://api.github.com/users/xqdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xqdan/subscriptions","organizations_url":"https://api.github.com/users/xqdan/orgs","repos_url":"https://api.github.com/users/xqdan/repos","events_url":"https://api.github.com/users/xqdan/events{/privacy}","received_events_url":"https://api.github.com/users/xqdan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-28T14:24:49Z","updated_at":"2018-03-01T18:53:15Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/dmlc/tvm/pulls/942","html_url":"https://github.com/dmlc/tvm/pull/942","diff_url":"https://github.com/dmlc/tvm/pull/942.diff","patch_url":"https://github.com/dmlc/tvm/pull/942.patch"},"body":"enable B and C reuse A1 buffer, before this patch, B(200 int16) took all space of A1(200 float32) \r\n```\r\nwith ib.for_range(0, 10, name=\"j\") as j:\r\n            A = ib.allocate(\"float32\", 200, name=\"A\", scope=\"local.L0A\")\r\n            A1 = ib.allocate(\"float32\", 200, name=\"A1\", scope=\"local.L0A\")\r\n            A[j] = 1.2\r\n            A1[j] = 1.3\r\n            B = ib.allocate(\"int16\", 200, name=\"B\", scope=\"local.L0A\")\r\n            B[j] = tvm.const(1, \"int16\")\r\n            C = ib.allocate(\"int16\", 200, name=\"C\", scope=\"local.L0A\")\r\n            C[j] = tvm.const(1, \"int16\")\r\n            D = ib.allocate(\"int16\", 200, name=\"D\", scope=\"local.L0A\")\r\n            D[j] = B[j] + C[j]\r\n            E = ib.allocate(\"int16\", 400, name=\"E\", scope=\"local.L0A\")\r\n            E[j] = tvm.const(1, \"int16\")\r\n            A2 = ib.allocate(\"float32\", 200, name=\"A2\", scope=\"local.L0A\")\r\n            A2[j] = A[j]\r\n```\r\nalso add a case for \r\n```\r\n// then start looking at smaller buffers.\r\n      for (auto it = mid; it != begin;) {\r\n        --it;\r\n        StorageEntry *e = it->second;\r\n        if (e->attach_scope_ != attach_scope) continue;\r\n        if (e->scope != scope) continue;\r\n        if (e->elem_type != op->type.element_of()) continue;\r\n        const_free_map_.erase(it);\r\n        return e;\r\n      }\r\n```"},"comment":{"url":"https://api.github.com/repos/dmlc/tvm/issues/comments/369692438","html_url":"https://github.com/dmlc/tvm/pull/942#issuecomment-369692438","issue_url":"https://api.github.com/repos/dmlc/tvm/issues/942","id":369692438,"user":{"login":"tqchen","id":2577440,"avatar_url":"https://avatars3.githubusercontent.com/u/2577440?v=4","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T18:53:15Z","updated_at":"2018-03-01T18:53:15Z","author_association":"OWNER","body":"The current logic have a few problems, and I think we need to think the reuse algorithm more carefully\r\n\r\nWhat will happen when the smaller array get out of scope, can they get used by bigger ones again? It seems that we cannot. This brings the question on if it is worth of doing this kind of split\r\n"}}
{"actor":{"display_login":"tqchen"}}