-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Add (constant size) TensorLists to JIT, use them in cat and stack nodes #9948
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
Conversation
bed465e
to
467d7d1
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.
apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
467d7d1
to
ed70fd8
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.
apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@pytorchbot retest this please |
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.
This looks good! Cleans up a lot of stuff.
# is_positional_arg is a boolean list the same length as decl['arguments'] | ||
# that indicates if the argument should come from the postional list | ||
# of inputs. If false, the argument comes from the constant attributes | ||
kw_assignments = [] | ||
arguments = [] | ||
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
real_inputs = 0 | ||
for i, arg in enumerate(decl['arguments']): | ||
# This conditional allows us to process argument lists with a flattened argument list |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
# in some cases there are no inputs that are possibly attributes, so the | ||
# variants are actually the same. If so avoid generating both to save compilation | ||
# time. | ||
if all_real_arguments_are_inputs != only_tensors_are_inputs: | ||
variants += [',', emit_decl_variant(decl, only_tensors_are_inputs, has_tensorlist)] | ||
variants += [',', emit_decl_variant(decl, only_tensors_are_inputs)] |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
int64_t arg_pos = findArgument(schema(), name).first; | ||
// XXX: we don't have a single value we could give for a Tensor[], |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -523,11 +541,14 @@ struct GraphFuser { | |||
std::pair<graph_node_list::iterator, bool> scanNode(Node * consumer) { | |||
auto stage_guard = block->owningGraph()->setStageTemporary(consumer->stage()); | |||
if(isFusableAsExitNode(consumer)) { | |||
value_list inputs; | |||
auto consumer_inputs = consumer->kind() == aten::cat ? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
// Allow homogeneous tuples to be casted implicitly to lists of appropriate types | ||
if (arg.type->kind() == TypeKind::ListType && | ||
value->type()->kind() == TypeKind::TupleType && | ||
value->type()->isSubtypeOf(arg.type)) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
c4b8a29
to
1b3503c
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.
apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
…es (pytorch#9948) Summary: zdevito Pull Request resolved: pytorch#9948 Reviewed By: ezyang Differential Revision: D9033666 Pulled By: apaszke fbshipit-source-id: 02d75e391ed6dee62500842df50f0b6ee5e38846
… functions (#9969) Summary: This lays out initial support for taking and returning a richer set of types than only tensors. Floats and ints are already valid, lists are straightforward to add, tuples need some discussion. Based on top of #9948. Review only the last commit. zdevito Pull Request resolved: #9969 Reviewed By: zdevito Differential Revision: D9076973 Pulled By: apaszke fbshipit-source-id: 5a1fe912ea6b79ab2bfd0dcce265eb05855b5ff0
…es (pytorch#9948) Summary: zdevito Pull Request resolved: pytorch#9948 Reviewed By: ezyang Differential Revision: D9033666 Pulled By: apaszke fbshipit-source-id: 02d75e391ed6dee62500842df50f0b6ee5e38846
… functions (pytorch#9969) Summary: This lays out initial support for taking and returning a richer set of types than only tensors. Floats and ints are already valid, lists are straightforward to add, tuples need some discussion. Based on top of pytorch#9948. Review only the last commit. zdevito Pull Request resolved: pytorch#9969 Reviewed By: zdevito Differential Revision: D9076973 Pulled By: apaszke fbshipit-source-id: 5a1fe912ea6b79ab2bfd0dcce265eb05855b5ff0
@zdevito