-
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] Fix code generation for packed functions + tuples #3287
Conversation
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.
src/relay/op/tensor/transform.cc
Outdated
@@ -292,7 +292,7 @@ RELAY_REGISTER_OP("concatenate") | |||
.add_type_rel("Concatenate", ConcatenateRel) | |||
.set_attr<FInferCorrectLayout>("FInferCorrectLayout", ConcatenateLayout) | |||
.set_attr<FTVMCompute>("FTVMCompute", ConcatenateCompute) | |||
.set_attr<TOpPattern>("TOpPattern", kInjective); | |||
.set_attr<TOpPattern>("TOpPattern", kOpaque); |
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.
Maybe leave this line out of the PR?
Please remove concat opaque property for now, and consider manually construct a function that needs to deal with such a case |
I don't think it is possible to write such a function because anything that uses tuples gets fused currently. Used |
} else if (auto tuple_ty = ty.as<TupleTypeNode>()) { | ||
for (size_t f = 0; f < tuple_ty->fields.size(); f++) { | ||
const auto& field = tuple_ty->fields[f]; | ||
CHECK(field.as<TensorTypeNode>()) |
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.
can you extend it and allow recursive tuple? it is more uniform this way.
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 really want to do it right now, recursive is a pain given the way the code generator is written right now. This is mostly to fix CI breakage, I would like to make some updates to compiler likely after FCRC tutorial.
Thanks, @jroesch @MarisaKirisame @wweic , this PR is now merged |
Disabling fusion for concat in #3268 uncovered a bug in the VM compiler, this fixes it.
We were previously not unpacking tuples, this changes code generation to unpack the tuples into registers before invoking the function.
cc @wweic @zhiics @icemelon9 @MarisaKirisame