【Inference Optimize】Support setting environment variables to enable stream_k #74317
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 Category
Inference
PR Types
Performance
Description
Pcard-71500
1、Support enabling stream_k by setting the environment variable
export CUTLASS_GEMM_STREAM_K=12、stream_k can be used to accelerate the performance of wint8/wint4 dense gemm operators.
3、In actual tests, we obtained performance gains of about 15% for wint4 and about 30% for wint8.
4、At the same time, we have added a new executable single test. The previous single test did not execute the operator.
5、Now you can enable this acceleration by setting
export CUTLASS_GEMM_STREAM_K=16、If you want to reproduce the performance gain, use the following command:
ncu --set full -o profile -k Kernel2 python ./Paddle/test/quantization/test_weight_only_linear.py::WeightOnlyLinear_stream_k_TestCase