Skip to content

Conversation

@Lunderberg
Copy link
Contributor

Previously, kDeviceThreadAxis defined the IterVar to be used for each thread/block axis, and kUseDynamicSharedMemoryTag defined whether dynamic memory allocations exist, which are primarily used to produce a list of strings by tvm::codegen::ExtractFuncInfo. Because kDeviceThreadAxis is a Array<IterVar>, the IterVar is used prior to its definition site at tir::attr::thread_extent, which results in errors when attempting to round-trip through TVMScript.

This commit replaces these attributes with
attr::kKernelLaunchParams, which directly contains the kernel launch parameters. These are expressed as an Array<String>, allowing the generated TVMScript to successfully round-trip.

This is part of changes described in #14486, to improve round-trip TVMScript failures that occur in lowering.

Previously, `kDeviceThreadAxis` defined the IterVar to be used for
each thread/block axis, and `kUseDynamicSharedMemoryTag` defined
whether dynamic memory allocations exist, which are primarily used to
produce a list of strings by `tvm::codegen::ExtractFuncInfo`.  Because
`kDeviceThreadAxis` is a `Array<IterVar>`, the IterVar is used prior
to its definition site at `tir::attr::thread_extent`, which results in
errors when attempting to round-trip through TVMScript.

This commit replaces these attributes with
`attr::kKernelLaunchParams`, which directly contains the kernel launch
parameters.  These are expressed as an `Array<String>`, allowing the
generated TVMScript to successfully round-trip.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Apr 4, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@Lunderberg
Copy link
Contributor Author

@tvm-bot rerun

@vinx13 vinx13 merged commit 28206d8 into apache:main Apr 5, 2023
@Lunderberg Lunderberg deleted the func_attr_launch_params branch April 5, 2023 22:02
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Apr 10, 2023
…#14495)

Previously, `kDeviceThreadAxis` defined the IterVar to be used for
each thread/block axis, and `kUseDynamicSharedMemoryTag` defined
whether dynamic memory allocations exist, which are primarily used to
produce a list of strings by `tvm::codegen::ExtractFuncInfo`.  Because
`kDeviceThreadAxis` is a `Array<IterVar>`, the IterVar is used prior
to its definition site at `tir::attr::thread_extent`, which results in
errors when attempting to round-trip through TVMScript.

This commit replaces these attributes with
`attr::kKernelLaunchParams`, which directly contains the kernel launch
parameters.  These are expressed as an `Array<String>`, allowing the
generated TVMScript to successfully round-trip.
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Apr 10, 2023
A follow-up from apache#14495, applying
the same change in CodeGenWebGPU.
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request Apr 10, 2023
A follow-up from apache#14495, applying
the same change in CodeGenWebGPU.
Lunderberg added a commit to Lunderberg/tvm that referenced this pull request May 12, 2023
A follow-up from apache#14495, applying
the same change in CodeGenWebGPU.
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