[Unity][Dlight] Choose perfect spatial factor in reduction rule#16101
Merged
Hzfengsy merged 1 commit intoapache:unityfrom Nov 10, 2023
Merged
[Unity][Dlight] Choose perfect spatial factor in reduction rule#16101Hzfengsy merged 1 commit intoapache:unityfrom
Hzfengsy merged 1 commit intoapache:unityfrom
Conversation
junrushao
reviewed
Nov 10, 2023
Comment on lines
+208
to
+214
| s_factor = [i.dom for i in block_info.iters if i.kind == "S"][-1] | ||
| # get perfect spatial factor, spatial factor should be divide the innermost spatial loop so | ||
| # that the block after r_factor and be reversed compute at the original scope | ||
| while len_tx > 1: | ||
| if s_factor % len_tx == 0: | ||
| break | ||
| len_tx -= 1 |
Member
There was a problem hiding this comment.
Would be nice if we have a util method _get_perfect_tile_factor instead of adding an extra block_info parameter
junrushao
approved these changes
Nov 10, 2023
Member
junrushao
left a comment
There was a problem hiding this comment.
Great work! Thanks for addressing this issue!
Member
|
A general question: Does "perfect tiling" work for all cases? Specifically, is it the best way for those kernels with prime extents? |
Member
Author
|
This is like a fallback solution. If the extent is prime number, thread size will be either the extent or 1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixed mlc-ai/mlc-llm#1105
cc @tqchen @junrushao @Hzfengsy