Skip to content

Conversation

@Lunderberg
Copy link
Contributor

Previously, the TE placeholders representing relay function parameters were all named "placeholder", which could be difficult to follow when debugging larger functions.

@Lunderberg
Copy link
Contributor Author

Rebase onto main following #10535

@Lunderberg Lunderberg force-pushed the relay_name_to_te_placeholder branch from 564bf5e to c5f19dc Compare March 14, 2022 14:26
@Lunderberg
Copy link
Contributor Author

Rebase onto main following merge conflict with #10577.

@Lunderberg
Copy link
Contributor Author

Current CI failures due to checks for the name "placeholder" in auto_scheduler (link). Will investigate further as time allows, as I'm not sure the history of this check.

Copy link
Contributor

@tkonolige tkonolige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very helpful change. Thanks @Lunderberg!

@Lunderberg Lunderberg force-pushed the relay_name_to_te_placeholder branch from 68d2c5b to 9ac6636 Compare March 22, 2022 19:10
@areusch
Copy link
Contributor

areusch commented Apr 11, 2022

@Lunderberg what's the status on this one?

@Lunderberg
Copy link
Contributor Author

Currently there's one CI failure that I haven't had time to track down yet. The error message occurs during memory verification, that a buffer is undefined, but likely is caused by an earlier pass failing to update a buffer.

@Lunderberg Lunderberg force-pushed the relay_name_to_te_placeholder branch from 9ac6636 to f163bdd Compare April 19, 2022 14:21
@Lunderberg
Copy link
Contributor Author

Rebased onto main, since the failing test case was disabled in #10717.

@Lunderberg Lunderberg force-pushed the relay_name_to_te_placeholder branch 2 times, most recently from 47e9550 to 30c4c8b Compare April 26, 2022 14:14
@Lunderberg
Copy link
Contributor Author

I let this one languish long enough that I no longer trust the CI checks to be up-to-date. Re-running CI.

Previously, the TE placeholders representing relay function parameters
were all named `"placeholder"`, which could be difficult to follow
when debugging larger functions.
The tensor name "ethos-u", once passed through from relay to TE,
resulted in invalid C++ codegen.
The tensor name is part of the hash used for these results, so the
previous hashes are no longer valid.
@Lunderberg Lunderberg force-pushed the relay_name_to_te_placeholder branch from 8a70448 to c7dc0ff Compare September 13, 2022 15:55
@Lunderberg Lunderberg merged commit a408493 into apache:main Sep 14, 2022
@Lunderberg Lunderberg deleted the relay_name_to_te_placeholder branch September 14, 2022 14:23
junrushao pushed a commit that referenced this pull request Sep 26, 2022
#10516 used the Relay parameter name when lowering to TE. However, this creates an issue when the parameter name is empty. This is legal in Relay, but results in errors during code generation. For example, this is the generated CUDA kernel for bias add:

```
extern "C" __global__ void __launch_bounds__(1024) fused_raf_op_tvm_add_kernel0(
    float* __restrict__ T_add,
    float* __restrict__ , /* Name is missing and it results in compile errors. */
    float* __restrict__ _1) {
    T_add[((((int)blockIdx.x) * 1024) + ((int)threadIdx.x))] = ([((((int)blockIdx.x) * 1024) + ((int)threadIdx.x))] + _1[((((((int)blockIdx.x) * 16) + (((int)threadIdx.x) >> 6)) % 54) / 9)]);
}
```

This PR adds "placeholder" back as a default to make sure no empty string will be passed when lowering to TE.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
…che#10516)

* [Relay][TE] Use Relay parameter name to generated TE tensor name

Previously, the TE placeholders representing relay function parameters
were all named `"placeholder"`, which could be difficult to follow
when debugging larger functions.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
apache#10516 used the Relay parameter name when lowering to TE. However, this creates an issue when the parameter name is empty. This is legal in Relay, but results in errors during code generation. For example, this is the generated CUDA kernel for bias add:

```
extern "C" __global__ void __launch_bounds__(1024) fused_raf_op_tvm_add_kernel0(
    float* __restrict__ T_add,
    float* __restrict__ , /* Name is missing and it results in compile errors. */
    float* __restrict__ _1) {
    T_add[((((int)blockIdx.x) * 1024) + ((int)threadIdx.x))] = ([((((int)blockIdx.x) * 1024) + ((int)threadIdx.x))] + _1[((((((int)blockIdx.x) * 16) + (((int)threadIdx.x) >> 6)) % 54) / 9)]);
}
```

This PR adds "placeholder" back as a default to make sure no empty string will be passed when lowering to TE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants