add triton_group_norm#4
Open
nishirong wants to merge 19 commits intozhoutianzi666:jieru_tritonfrom
Open
Conversation
|
|
||
| tune_and_invoke_part_with_two_kernels = tune_and_invoke_part.replace("${op_name}", "${first_kernel_name}").replace("run_triton_kernel", "run_triton_first_kernel") + tune_and_invoke_part.replace("${op_name}", "${second_kernel_name}").replace("run_triton_kernel", "run_triton_second_kernel") | ||
|
|
||
| # tune_and_invoke_part_with_two_kernels = """ |
Owner
There was a problem hiding this comment.
如果下面的东西的确可以由上面的语句产生,就把注释的语句都删了吧
| offset_block = tl.arange(0, BLOCK_SIZE_M) | ||
| data_start = batch_id * batch_stride + group_id * group_stride | ||
| sample_ptrs = sample_ptr + data_start + offset_channel[:, None] * channel_stride + offset_block[None, :] * hw_stride + block_id * BLOCK_SIZE_M | ||
| # 计算均值 |
| _sum = tl.sum(sample) | ||
|
|
||
| _sum_squares = tl.sum(sample * sample) | ||
| output_start = batch_id * group_num + group_id + tl.arange(0,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.
PR types
PR changes
Describe
实现 triton group norm