-
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
[REFACTOR] Initialize Unified IR Type Data Structures #4616
Conversation
cc @icemelon9 @jroesch @zhiics @wweic @yzhliu @MarisaKirisame @slyubomirsky |
75a97c1
to
92734a0
Compare
enum TypeKind : int { | ||
kType = 0, | ||
/*! \brief Template variable in shape expression. */ | ||
kShapeVar = 1, |
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.
why the separate between kshapevar and kshape?
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.
I don't know as it was migrated from the original file, we can discuss how to improve in subsequent PRs
This PR moves a few base types from relay to the ir sub-folder. These types will serve as a common type system across the stack. Notably, we want to be able to use the same FuncType for all function signatures. I tried to make a minimum move to bring the necessary dependencies for a FuncType. We can discuss what additional things we want to move as a follow-up. Notably, because the TensorType will have a dependency on low-level Expr, we will need to break the type.h into two files and introduce a tensor_type.h(or leave them in relay for now).
I like the unification of the types for low-level IR and relay. I have one question on the tensor type. Since TE also has Tensor, will it have the TensorType? |
To simplify the treatment, most of the low-level expression won't have a tensor type, although by definition it is possible to allow a var to have a tensor type and Pass them to a function, you cannot do anything other than pass it through calls though, because operations like Add, Shuffle only accept normal types. TensorType is also not very well defined because its layout binding are not specified. BufferType might be a better type for such objects in the low-level but we can discuss further. |
Thanks @icemelon9 @zhiics @MarisaKirisame |
This PR moves a few base types from relay to the ir sub-folder. These types will serve as a common type system across the stack. Notably, we want to be able to use the same FuncType for all function signatures. I tried to make a minimum move to bring the necessary dependencies for a FuncType. We can discuss what additional things we want to move as a follow-up. Notably, because the TensorType will have a dependency on low-level Expr, we will need to break the type.h into two files and introduce a tensor_type.h(or leave them in relay for now).
This PR moves a few base types from relay to the ir sub-folder. These types will serve as a common type system across the stack. Notably, we want to be able to use the same FuncType for all function signatures. I tried to make a minimum move to bring the necessary dependencies for a FuncType. We can discuss what additional things we want to move as a follow-up. Notably, because the TensorType will have a dependency on low-level Expr, we will need to break the type.h into two files and introduce a tensor_type.h(or leave them in relay for now).
This PR moves a few base types from relay to the ir sub-folder. These types will serve as a common type system across the stack. Notably, we want to be able to use the same FuncType for all function signatures. I tried to make a minimum move to bring the necessary dependencies for a FuncType. We can discuss what additional things we want to move as a follow-up. Notably, because the TensorType will have a dependency on low-level Expr, we will need to break the type.h into two files and introduce a tensor_type.h(or leave them in relay for now).
Depends on #4615
This PR moves a few base types from relay to the ir sub-folder.
These types will serve as a common type system across the stack.
Notably, we want to be able to use the same FuncType for all function signatures.
I tried to make a minimum move to bring the necessary dependencies for a FuncType.
We can discuss what additional things we want to move as a follow-up.
Because the TensorType will have a dependency on low-level Expr,
we will need to break the type.h into two files and introduce a
tensor_type.h(or leave them in relay for now).