Skip to content

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
@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