[BYOC] Is multiple outputs really supported in DNNL codegen?

Hi, since the PR https://github.com/apache/incubator-tvm/pull/5288, I was under impression that DNNL codegen supports multiple outputs.

But there is this assertion that seems to be saying that C codegen-based backend allows only a single output:

I’m a bit confused now. What is the situation? @comaniac @zhiics

1 Like

Ahh…if I remember correctly, I refined the DNNL codegen in the PR you pointed out, so DNNL codegen now should support the op with multiple outputs such as batch norm as the first summary point in the PR description. However, we didn’t support the general C codegen accordingly, meaning that the subgraph with multiple outputs wasn’t supported in that PR. I remember there was an issue when I was trying to implement multiple output support for subgraphs, but I don’t remember the details.

@masahi finally get some time to look into the confusing message. Here is a complete explanation:

First, I checked the DNNL codegen and confirmed that it should be able to support a subgraph with multiple outputs whatever the subgraph has one or multiple operators:

With the above statement, I revisited the assertion you pointed out, and realized that we should refine the message. Currently the way we support multiple outputs is to create a new tuple node of them as a single output. That’s why our unit tests are all passed.

On the other hand, “creating a new tuple node of all outputs” is performed by partition graph pass. In order to make sure users run the pass in advance, we still need this checker. Sorry for the confusion, and we should definitely improve the message.

1 Like


Could you please provide example code to creating a new tuple node of all outputs from partition?