Skip to content
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

Merged
merged 1 commit into from
Jan 4, 2020

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Jan 3, 2020

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).

@tqchen
Copy link
Member Author

tqchen commented Jan 3, 2020

@tqchen tqchen force-pushed the type branch 2 times, most recently from 75a97c1 to 92734a0 Compare January 3, 2020 23:40
enum TypeKind : int {
kType = 0,
/*! \brief Template variable in shape expression. */
kShapeVar = 1,
Copy link
Contributor

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?

Copy link
Member Author

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).
@icemelon
Copy link
Member

icemelon commented Jan 4, 2020

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?

@tqchen
Copy link
Member Author

tqchen commented Jan 4, 2020

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.

@tqchen tqchen merged commit 1ecd3ee into apache:master Jan 4, 2020
@tqchen
Copy link
Member Author

tqchen commented Jan 4, 2020

Thanks @icemelon9 @zhiics @MarisaKirisame

@tqchen tqchen deleted the type branch January 6, 2020 19:19
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 26, 2020
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).
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 28, 2020
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).
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2020
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants