-
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
[Relay][VM]Compiling pattern matching #3470
Conversation
I don't have any issues with these changes (seems like a reasonable approach to supporting matching), though granted I had not previously closely followed VM development. Glad to see all the tests added. |
9f668b0
to
3ef91a8
Compare
How hard is it to refactor the decision tree into a common api? |
@MarisaKirisame It's easy to move out |
@wweic into pass_util? It is something people can use when writing pass. |
Why not just use tensors? we could instead specialize for the 0-rank case behind the scenes. I'm wary of opcode bloat and proliferation of data types. |
@jroesch Thanks for the comment. I'm not sure as well. I think I can get rid of |
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
Maybe we can generalize the boolean comparison instruction? maybe we do need to type it though |
* [Relay][VM]Compiling pattern matching * Fix lint * Remove debug code * Move TreeNode definition * merge ifi and selecti, todo: remove them * fix lint * remove ifi and selecti * rename GetTagi to GetTag * fix dltype * fix more dltype * Generalize If and select, and rename to Ifi and Selecti * Fix lint * Rename Ifi to If * Change register default to match value * Remove bad specialization for Move * Stop use Select * Remove Select * TreeNode refactor * Change entry_func name * Remove Cmp due to rebase issue
* [Relay][VM]Compiling pattern matching * Fix lint * Remove debug code * Move TreeNode definition * merge ifi and selecti, todo: remove them * fix lint * remove ifi and selecti * rename GetTagi to GetTag * fix dltype * fix more dltype * Generalize If and select, and rename to Ifi and Selecti * Fix lint * Rename Ifi to If * Change register default to match value * Remove bad specialization for Move * Stop use Select * Remove Select * TreeNode refactor * Change entry_func name * Remove Cmp due to rebase issue
* [Relay][VM]Compiling pattern matching * Fix lint * Remove debug code * Move TreeNode definition * merge ifi and selecti, todo: remove them * fix lint * remove ifi and selecti * rename GetTagi to GetTag * fix dltype * fix more dltype * Generalize If and select, and rename to Ifi and Selecti * Fix lint * Rename Ifi to If * Change register default to match value * Remove bad specialization for Move * Stop use Select * Remove Select * TreeNode refactor * Change entry_func name * Remove Cmp due to rebase issue
GetTag
: Get the object tag and stores theTensorCell
object.Loadconsti
: Load a primitive int value into aTensorCell
Fatal
: Fail the VM executionIfi
: It tests 2 registertest
andtarget
, if they are equal, execute then branch, otherwise else branch.Selecti
: It tests 2 integer registertest
andtarget
, if equal, returnop1
, otherwiseop2
.cc: @jroesch @MarisaKirisame @icemelon9 @zhiics @slyubomirsky @junrushao1994