-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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
@@ -111,6 +112,12 @@ class BufferAllocationLocator : public StmtExprMutator { | |||
collector(func->body); | |||
unmanaged_allocations_ = collector.unmanaged_allocations; | |||
|
|||
for (Var param : func->params) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.