-
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][USMP] adding the pass to convert to pool offsets #9418
[TIR][USMP] adding the pass to convert to pool offsets #9418
Conversation
a friendly ping @mbs-octoml ! |
93a81d8
to
f95f642
Compare
Hi @manupa-arm, I was waiting for #8468 to go in and #9214 to come out of DRAFT. Is that ok? |
@mbs-octoml , yes Im also waiting for #8468 to go in :D -- so when #9214 comes out of draft it doesn't include changes belonging to #8468 |
f95f642
to
f2841f5
Compare
e5f1867
to
508b61d
Compare
Ping for reviews : @mbaret @mbs-octoml |
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 for including the comments. Made the mistake of looking at this late on a Fri afternoon and my eyes started glazing over, but seems the main things are the new load_node in the AllocateNode visitor and capturing AllocatedPoolInfo on func/global params.
I'm still finding my way in TIR land so defer to say @junrushao1994 or similar for proper review.
@@ -35,7 +35,12 @@ namespace tir { | |||
LetStmt::LetStmt(Var var, PrimExpr value, Stmt body, Span span) { | |||
ICHECK(value.defined()); | |||
ICHECK(body.defined()); | |||
ICHECK_EQ(value.dtype(), var.dtype()); | |||
auto vdtype = value.dtype(); | |||
if (var->type_annotation.as<PointerTypeNode>()) { |
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 add a comment? how did this ever work?
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.
Added a comment.
508b61d
to
977608e
Compare
Thanks @mbs-octoml ! I've done the necessary changes. Pinging folks @lhutton1 @ekalda @leandron @NicolaLancellotti for review/approval |
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 @manupa-arm, I'm not all that familiar with USMP but gave this a quick look over. Just a few minor things - feel free to address them in a follow up.
tests/python/unittest/test_tir_usmp_transform_convert_pool_allocations_to_offsets.py
Outdated
Show resolved
Hide resolved
977608e
to
52a4f12
Compare
Thanks! @NicolaLancellotti @lhutton1 . I've addressed your comments. |
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.
LGTM
This commit adds a transform pass that consumes the planned pool allocations using memory planning algorithm that convertes them to pool offsets. * adds two test cases for a linear structure with two pools * adds test case with a single pool for residual structures Change-Id: I9d31e854461b5c21df72d1452120d286b96791c0
* Adding a toggle to produce TIR that is TVMScript printable for unit testing * Fixing the unit tests * Ensure deterministic pool variable ordering. Change-Id: I317675df03327b0ebbf4ca074255384e63f07cd6
Fixing the references after changes in the memory planning algorithm. Change-Id: Id7c22356fd5de43d10a2b4fc70e978af2c6d599d
* fixing the lint Change-Id: I7ff920b92d14a9919c930a4b35a2169c77a57dd1
* removing unnecessary defitinitions * remove global var map * adding explaination for let bindings to pointer type Change-Id: I31bd1a9f3057ee7f06252263565b0f75c51e6d13
* rebase changes * making imports absolute * fixing typos and removing unnecesary lines Change-Id: I4c94b9955b001513fecb39ca94f81b1ad99c7bfc
* fixing typos Change-Id: I42c557fd394aefdf8c2e825c4e88770eb0732f9b
9ce59ee
to
2c6cf6c
Compare
@leandron can we get this in ? |
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.
LGTM
* [TIR][USMP] adding the pass to convert to pool offsets This commit adds a transform pass that consumes the planned pool allocations using memory planning algorithm that convertes them to pool offsets. * adds two test cases for a linear structure with two pools * adds test case with a single pool for residual structures Change-Id: I9d31e854461b5c21df72d1452120d286b96791c0 * [TIR][USMP] adding the pass to convert to pool offsets * Adding a toggle to produce TIR that is TVMScript printable for unit testing * Fixing the unit tests * Ensure deterministic pool variable ordering. Change-Id: I317675df03327b0ebbf4ca074255384e63f07cd6 * [TIR][USMP] adding the pass to convert to pool offsets Fixing the references after changes in the memory planning algorithm. Change-Id: Id7c22356fd5de43d10a2b4fc70e978af2c6d599d * [TIR][USMP] adding the pass to convert to pool offsets * fixing the lint Change-Id: I7ff920b92d14a9919c930a4b35a2169c77a57dd1 * [TIR][USMP] adding the pass to convert to pool offsets * removing unnecessary defitinitions * remove global var map * adding explaination for let bindings to pointer type Change-Id: I31bd1a9f3057ee7f06252263565b0f75c51e6d13 * [TIR][USMP] adding the pass to convert to pool offsets * rebase changes * making imports absolute * fixing typos and removing unnecesary lines Change-Id: I4c94b9955b001513fecb39ca94f81b1ad99c7bfc * [TIR][USMP] adding the pass to convert to pool offsets * fixing typos Change-Id: I42c557fd394aefdf8c2e825c4e88770eb0732f9b
* [TIR][USMP] adding the pass to convert to pool offsets This commit adds a transform pass that consumes the planned pool allocations using memory planning algorithm that convertes them to pool offsets. * adds two test cases for a linear structure with two pools * adds test case with a single pool for residual structures Change-Id: I9d31e854461b5c21df72d1452120d286b96791c0 * [TIR][USMP] adding the pass to convert to pool offsets * Adding a toggle to produce TIR that is TVMScript printable for unit testing * Fixing the unit tests * Ensure deterministic pool variable ordering. Change-Id: I317675df03327b0ebbf4ca074255384e63f07cd6 * [TIR][USMP] adding the pass to convert to pool offsets Fixing the references after changes in the memory planning algorithm. Change-Id: Id7c22356fd5de43d10a2b4fc70e978af2c6d599d * [TIR][USMP] adding the pass to convert to pool offsets * fixing the lint Change-Id: I7ff920b92d14a9919c930a4b35a2169c77a57dd1 * [TIR][USMP] adding the pass to convert to pool offsets * removing unnecessary defitinitions * remove global var map * adding explaination for let bindings to pointer type Change-Id: I31bd1a9f3057ee7f06252263565b0f75c51e6d13 * [TIR][USMP] adding the pass to convert to pool offsets * rebase changes * making imports absolute * fixing typos and removing unnecesary lines Change-Id: I4c94b9955b001513fecb39ca94f81b1ad99c7bfc * [TIR][USMP] adding the pass to convert to pool offsets * fixing typos Change-Id: I42c557fd394aefdf8c2e825c4e88770eb0732f9b
* [TIR][USMP] adding the pass to convert to pool offsets This commit adds a transform pass that consumes the planned pool allocations using memory planning algorithm that convertes them to pool offsets. * adds two test cases for a linear structure with two pools * adds test case with a single pool for residual structures Change-Id: I9d31e854461b5c21df72d1452120d286b96791c0 * [TIR][USMP] adding the pass to convert to pool offsets * Adding a toggle to produce TIR that is TVMScript printable for unit testing * Fixing the unit tests * Ensure deterministic pool variable ordering. Change-Id: I317675df03327b0ebbf4ca074255384e63f07cd6 * [TIR][USMP] adding the pass to convert to pool offsets Fixing the references after changes in the memory planning algorithm. Change-Id: Id7c22356fd5de43d10a2b4fc70e978af2c6d599d * [TIR][USMP] adding the pass to convert to pool offsets * fixing the lint Change-Id: I7ff920b92d14a9919c930a4b35a2169c77a57dd1 * [TIR][USMP] adding the pass to convert to pool offsets * removing unnecessary defitinitions * remove global var map * adding explaination for let bindings to pointer type Change-Id: I31bd1a9f3057ee7f06252263565b0f75c51e6d13 * [TIR][USMP] adding the pass to convert to pool offsets * rebase changes * making imports absolute * fixing typos and removing unnecesary lines Change-Id: I4c94b9955b001513fecb39ca94f81b1ad99c7bfc * [TIR][USMP] adding the pass to convert to pool offsets * fixing typos Change-Id: I42c557fd394aefdf8c2e825c4e88770eb0732f9b
* [TIR][USMP] adding the pass to convert to pool offsets This commit adds a transform pass that consumes the planned pool allocations using memory planning algorithm that convertes them to pool offsets. * adds two test cases for a linear structure with two pools * adds test case with a single pool for residual structures Change-Id: I9d31e854461b5c21df72d1452120d286b96791c0 * [TIR][USMP] adding the pass to convert to pool offsets * Adding a toggle to produce TIR that is TVMScript printable for unit testing * Fixing the unit tests * Ensure deterministic pool variable ordering. Change-Id: I317675df03327b0ebbf4ca074255384e63f07cd6 * [TIR][USMP] adding the pass to convert to pool offsets Fixing the references after changes in the memory planning algorithm. Change-Id: Id7c22356fd5de43d10a2b4fc70e978af2c6d599d * [TIR][USMP] adding the pass to convert to pool offsets * fixing the lint Change-Id: I7ff920b92d14a9919c930a4b35a2169c77a57dd1 * [TIR][USMP] adding the pass to convert to pool offsets * removing unnecessary defitinitions * remove global var map * adding explaination for let bindings to pointer type Change-Id: I31bd1a9f3057ee7f06252263565b0f75c51e6d13 * [TIR][USMP] adding the pass to convert to pool offsets * rebase changes * making imports absolute * fixing typos and removing unnecesary lines Change-Id: I4c94b9955b001513fecb39ca94f81b1ad99c7bfc * [TIR][USMP] adding the pass to convert to pool offsets * fixing typos Change-Id: I42c557fd394aefdf8c2e825c4e88770eb0732f9b
* [TIR][USMP] adding the pass to convert to pool offsets This commit adds a transform pass that consumes the planned pool allocations using memory planning algorithm that convertes them to pool offsets. * adds two test cases for a linear structure with two pools * adds test case with a single pool for residual structures Change-Id: I9d31e854461b5c21df72d1452120d286b96791c0 * [TIR][USMP] adding the pass to convert to pool offsets * Adding a toggle to produce TIR that is TVMScript printable for unit testing * Fixing the unit tests * Ensure deterministic pool variable ordering. Change-Id: I317675df03327b0ebbf4ca074255384e63f07cd6 * [TIR][USMP] adding the pass to convert to pool offsets Fixing the references after changes in the memory planning algorithm. Change-Id: Id7c22356fd5de43d10a2b4fc70e978af2c6d599d * [TIR][USMP] adding the pass to convert to pool offsets * fixing the lint Change-Id: I7ff920b92d14a9919c930a4b35a2169c77a57dd1 * [TIR][USMP] adding the pass to convert to pool offsets * removing unnecessary defitinitions * remove global var map * adding explaination for let bindings to pointer type Change-Id: I31bd1a9f3057ee7f06252263565b0f75c51e6d13 * [TIR][USMP] adding the pass to convert to pool offsets * rebase changes * making imports absolute * fixing typos and removing unnecesary lines Change-Id: I4c94b9955b001513fecb39ca94f81b1ad99c7bfc * [TIR][USMP] adding the pass to convert to pool offsets * fixing typos Change-Id: I42c557fd394aefdf8c2e825c4e88770eb0732f9b
* [TIR][USMP] adding the pass to convert to pool offsets This commit adds a transform pass that consumes the planned pool allocations using memory planning algorithm that convertes them to pool offsets. * adds two test cases for a linear structure with two pools * adds test case with a single pool for residual structures Change-Id: I9d31e854461b5c21df72d1452120d286b96791c0 * [TIR][USMP] adding the pass to convert to pool offsets * Adding a toggle to produce TIR that is TVMScript printable for unit testing * Fixing the unit tests * Ensure deterministic pool variable ordering. Change-Id: I317675df03327b0ebbf4ca074255384e63f07cd6 * [TIR][USMP] adding the pass to convert to pool offsets Fixing the references after changes in the memory planning algorithm. Change-Id: Id7c22356fd5de43d10a2b4fc70e978af2c6d599d * [TIR][USMP] adding the pass to convert to pool offsets * fixing the lint Change-Id: I7ff920b92d14a9919c930a4b35a2169c77a57dd1 * [TIR][USMP] adding the pass to convert to pool offsets * removing unnecessary defitinitions * remove global var map * adding explaination for let bindings to pointer type Change-Id: I31bd1a9f3057ee7f06252263565b0f75c51e6d13 * [TIR][USMP] adding the pass to convert to pool offsets * rebase changes * making imports absolute * fixing typos and removing unnecesary lines Change-Id: I4c94b9955b001513fecb39ca94f81b1ad99c7bfc * [TIR][USMP] adding the pass to convert to pool offsets * fixing typos Change-Id: I42c557fd394aefdf8c2e825c4e88770eb0732f9b
This commit adds a transform pass that consumes the planned pool allocations using memory planning algorithm that convertes them to pool offsets.