Re: Incoporate Marlin for GPTQ checkpoints into tgis_native #66
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.
Resubmitting Marlin PR due to accidental removal
Motivation
This PR enables the use of Marlin kernel for GPTQ checkpoints. Marlin is shown to outperform Exllamav2 on Nvidia GPUs, especially for larger batch sizes.
Modifications
The code changes are mostly similar to exllamav2, except that it uses the Marlin kernel code and binding from the AutoGPTQ package instead of sourcing a separate marlin package. I adapted the QuantLinear implementation from AutoGPTQ with changes to remove codes that we don't need. Note that, my changes also enable marlin support for checkpoints that uses activation reordering (
desc_act=True
).Marlin can be turned on by setting environment variable
GPTQ_CUDA_TYPE=marlin
.Note that Marlin kernel only works on Nvidia GPUs with compute capability >= 8.0.
Result
The code needs to be more thoroughly tested both for the performance and correctness in the following scenarios:
desc_act=False
GPTQ checkpoints correctly with optimal performancedesc_act=True
GPTQ checkpoints correctly with optimal performance, with slightly worse performance than the previous scenarioRelated Issues
#51