Add fused_transpose_split_quant kernel #10657
Merged
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
Performance optimization
PR changes
APIs
Description
新增
fused_transpose_split_quant
算子,定义如下:注:该算子使用较为复杂,由于custom op不支持变长输出,所以我采用将输出从参数传入的方式,需要用户自己为输出分配空间。可以在Python端做一层包装,这样看起来更像一个函数式API,下面举了一个例子:
在H卡上与标准库验证过正确性,scale精度达到1e-7,out精度达到rtol=0.01 atol=0.2
性能测试
以上面的shape为例,在A100上达到81.8%的带宽利用率
Pcard-85711