[Performance] Introduce Marlin-based GEMM kernels for the calibration-free RTN-based quantization #21865
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.
This PR enhances the work started in #18768 and #20766 by introducing Marlin-based kernels for the calibration-free RTN-based quantization.
These kernels substantially improve the performance of dense models quantized with RTN.
We ran
benchmark_latencywith several Llama models on a machine equipped with H100 GPUs. The exact command was[RTN_NUM_BITS=4] python benchmark_latency.py --model <model> --n 1 --num-iters-warmup 3 --num-iters 10 --input-len 256 --output-len 32 -tp <#GPUs> --batch-size <batch> [--quantization rtn]Each data point is an average of 5 runs, the units are seconds (measuring generation latency, the lower the better).
Here are the results for Llama3.1-8B (ran on 1 GPU), for various batch sizes:
Here are the results for Llama3.3-70B (ran on 4 GPUs), for various batch sizes: