Skip to content
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

[DLight] Check for target in function attributes #16958

Merged
merged 1 commit into from
May 13, 2024

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, the dlight scheduling rules were applied solely based on the global tvm.target.Target.current(). However, a TIR PrimFunc may be annotated with the target, rather than using the global Target.current(). In this case, the dlight scheduling may produce a scheduled PrimFunc that is not compatible with its target. For example, using a thread binding to "threadIdx.x" on a CPU target.

This commit updates dlight to check for a TIR PrimFunc's annotations when scheduling, matching the behavior of tvm.build.

Prior to this commit, the `dlight` scheduling rules were applied
solely based on the global `tvm.target.Target.current()`.  However, a
TIR PrimFunc may be annotated with the target, rather than using the
global `Target.current()`.  In this case, the `dlight` scheduling
may produce a scheduled PrimFunc that is not compatible with its
target.  For example, using a thread binding to `"threadIdx.x"` on a
CPU target.

This commit updates `dlight` to check for a TIR PrimFunc's annotations
when scheduling, matching the behavior of `tvm.build`.
@masahi masahi merged commit eb242ec into apache:main May 13, 2024
19 checks passed
@Lunderberg Lunderberg deleted the dlight_check_for_target_func_attr branch May 13, 2024 20:18
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.

2 participants