-
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
[TRANSFORM] Fix virtual device annotation issue with BYOC subgraphs #13325
Conversation
Heterogeneous module partitioned by BYOC has functions nodes without any VirtualDevice definition (having FullyUnconstrained device). Ignoring the device here causes expr_virtual_devices_ being empty when PopVirtualDevice is called assuming above PushVirtualDevice is succeeded. PushVirtualDevice and PopVirtualDevice occurs as pairs across function body, hence it's better to insert the The Virtual Device for Uncontrained and Pop it subsequently.
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 |
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.
Hi @srkreddy1238, I didn't quite understand the conclusion you make,
PushVirtualDevice and PopVirtualDevice occurs as pairs across function body, hence it's better to insert the The Virtual Device for Uncontrained and Pop it subsequently
Naively I can understand why we skip pushing an unconstrained virtual device: If something is fully unconstrained then it's virtual device shouldn't influence the function body visitation. What issue is this causing in BYOC?
Is there a unit test you can consider contributing that can help illustrate the issue?
PushVirtualDevice and PopVirtualDevice maintains the current VirtualDevice information on stack
In the above IR the composite function I figured it out as part of large network. I am working on to facilitate a test case for the same. |
e9fc122
to
58ed940
Compare
02a8c8a
to
e24e5ea
Compare
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 @srkreddy1238, LGTM
@junrushao can you take a look on this ? |
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. Thanks
Our tests runs in CI and if we see green CI it means this change does not affect them and whole flow. I cannot answer if this change affects origin Mark's idea and if it does not brake anything in other places. Again, assuming that we have many tests for VirtualDevices and they passed, this change should be safe. |
e24e5ea
to
55b126c
Compare
@junrushao can you conclude this PR ? There are some follow up on this. |
Sure! It’s been approved for a while already. Not sure why it’s not merged yet |
…pache#13325) * [TRANSFORM] Fix virtual device anaotation issue with BYOC subgraphs Heterogeneous module partitioned by BYOC has functions nodes without any VirtualDevice definition (having FullyUnconstrained device). Ignoring the device here causes expr_virtual_devices_ being empty when PopVirtualDevice is called assuming above PushVirtualDevice is succeeded. PushVirtualDevice and PopVirtualDevice occurs as pairs across function body, hence it's better to insert the The Virtual Device for Uncontrained and Pop it subsequently. * * Test case Co-authored-by: Siva Rama Krishna Reddy B <sivb@blr-ubuntu-ripper.qualcomm.com>
…pache#13325) * [TRANSFORM] Fix virtual device anaotation issue with BYOC subgraphs Heterogeneous module partitioned by BYOC has functions nodes without any VirtualDevice definition (having FullyUnconstrained device). Ignoring the device here causes expr_virtual_devices_ being empty when PopVirtualDevice is called assuming above PushVirtualDevice is succeeded. PushVirtualDevice and PopVirtualDevice occurs as pairs across function body, hence it's better to insert the The Virtual Device for Uncontrained and Pop it subsequently. * * Test case Co-authored-by: Siva Rama Krishna Reddy B <sivb@blr-ubuntu-ripper.qualcomm.com>
Heterogeneous module partitioned by BYOC has functions nodes without any VirtualDevice definition (having FullyUnconstrained device). Ignoring the device here causes expr_virtual_devices_ being empty when PopVirtualDevice is called assuming above PushVirtualDevice is succeeded. PushVirtualDevice and PopVirtualDevice occurs as pairs across function body, hence it's better to insert the The Virtual Device for Uncontrained and Pop it subsequently.