You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/05/29 23:22:00 UTC
[GitHub] [incubator-tvm] comaniac opened a new pull request #5701: [BYOC] Support Tuple Output in C/DNNL Codegen
comaniac opened a new pull request #5701:
URL: https://github.com/apache/incubator-tvm/pull/5701
We previously supported multiple outputs in graph partition pass by creating a new tuple node as a single output. However, we missed a point that this tuple output has to be decomposed when generating C code.
Fortunately, TVM runtime already flats tuples to multiple tensors, so it's not hard to make runtime working. This PR modifies the C codegen accordingly. Note that although the new added unit test uses C codegen, I've tested locally and make sure this change is also applicable to DNNL.
cc @masahi (sorry for the confusions 😓 ), @zhiics
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] masahi merged pull request #5701: [BYOC] Support Tuple Output in C/DNNL Codegen
Posted by GitBox <gi...@apache.org>.
masahi merged pull request #5701:
URL: https://github.com/apache/incubator-tvm/pull/5701
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] masahi commented on pull request #5701: [BYOC] Support Tuple Output in C/DNNL Codegen
Posted by GitBox <gi...@apache.org>.
masahi commented on pull request #5701:
URL: https://github.com/apache/incubator-tvm/pull/5701#issuecomment-636260956
Thanks @comaniac @zhiics
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] zhiics commented on a change in pull request #5701: [BYOC] Support Tuple Output in C/DNNL Codegen
Posted by GitBox <gi...@apache.org>.
zhiics commented on a change in pull request #5701:
URL: https://github.com/apache/incubator-tvm/pull/5701#discussion_r432785625
##########
File path: tests/python/relay/test_pass_partition_graph.py
##########
@@ -201,8 +202,11 @@ def check_vm_result():
exe = runtime.vm.Executable.load_exec(code, lib)
vm = runtime.vm.VirtualMachine(exe)
vm.init(ctx)
- out = vm.run(**map_inputs)
- tvm.testing.assert_allclose(out.asnumpy(), result, rtol=tol, atol=tol)
+ outs = vm.run(**map_inputs)
+ outs = outs if len(outs) > 1 else [outs]
Review comment:
is `len(outs)` oaky? It doesn't necessarily be an ADTObj/array, right? what if it is an objectref (i.e. NDArray in this case)?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] comaniac commented on a change in pull request #5701: [BYOC] Support Tuple Output in C/DNNL Codegen
Posted by GitBox <gi...@apache.org>.
comaniac commented on a change in pull request #5701:
URL: https://github.com/apache/incubator-tvm/pull/5701#discussion_r432785888
##########
File path: tests/python/relay/test_pass_partition_graph.py
##########
@@ -201,8 +202,11 @@ def check_vm_result():
exe = runtime.vm.Executable.load_exec(code, lib)
vm = runtime.vm.VirtualMachine(exe)
vm.init(ctx)
- out = vm.run(**map_inputs)
- tvm.testing.assert_allclose(out.asnumpy(), result, rtol=tol, atol=tol)
+ outs = vm.run(**map_inputs)
+ outs = outs if len(outs) > 1 else [outs]
Review comment:
Yeah the test failed because of this. Changing to `isinstance(outs, runtime.container.ADT)`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] zhiics commented on pull request #5701: [BYOC] Support Tuple Output in C/DNNL Codegen
Posted by GitBox <gi...@apache.org>.
zhiics commented on pull request #5701:
URL: https://github.com/apache/incubator-tvm/pull/5701#issuecomment-636239753
@comaniac Thanks for adding this support. I always thought this was done yet...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org