[tir] fix buffer_decl buffer allocation#13906
Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
a46d778 to
ca96790
Compare
| collector(func->body); | ||
| unmanaged_allocations_ = collector.unmanaged_allocations; | ||
|
|
||
| for (Var param : func->params) { |
There was a problem hiding this comment.
| for (Var param : func->params) { | |
| for (const Var& param : func->params) { |
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| import tvm |
There was a problem hiding this comment.
Could you please add a testcase in tests/python/unittest/test_tir_transform_plan_update_buffer_allocation_location.py as the code changes are in the related file?
9166859 to
8d65c39
Compare
| A[i] = 0 | ||
|
|
||
| ir_mod = IRMod | ||
| built_mod = tvm.build(ir_mod) |
There was a problem hiding this comment.
It would be great to make the test "unit" enough, i.e., only test the related pass instead of a whole build workflow.
One of the common practices is to test the IRModule before and after the pass. Please see the test case test_1D_cascade_op_rolling_buffer() in the same file.
There was a problem hiding this comment.
Thanks, that's an excellent suggestion. Fixed (IMHO) in the newest version of the PR.
8d65c39 to
2851525
Compare
- Fix a bug where `buffer_decl`, combined with certain usage patterns of the resulting buffer, cause an TVM-internal assert failure during TIR-compilation.
2851525 to
2035a7e
Compare
|
Thanks @cconvey for the fixing and continuous improving |
buffer_decl, combined with certain usage patterns of the resulting buffer, cause an TVM-internal assert failure during TIR-compilation.