feat(llm): add QAT/Pruning/Sparsity model config support (#115)#126
Merged
feat(llm): add QAT/Pruning/Sparsity model config support (#115)#126
Conversation
Add support for loading models optimized with QAT, pruning, and sparsity: New config classes in loader.py: - QATQuantConfig: Parse QAT/QAD configs from TensorRT Model Optimizer and HuggingFace formats (AWQ, GPTQ, BNB, etc.) - PruningConfig: Detect structured pruning (pruned_heads) and unstructured pruning configs - SparsityConfig: Support 2:4 structured sparsity patterns for Ampere+ TensorCores - ModelOptimizationInfo: Aggregate all optimization info with has_any_optimization() and summary() helpers Supported formats: - TensorRT Model Optimizer hf_quant_config.json (NVFP4, FP8, INT8) - HuggingFace quantization_config (AWQ, GPTQ, BNB) - HuggingFace pruned_heads (structured pruning) - 2:4 sparsity pattern for sparse TensorCore ops Reference: - https://nvidia.github.io/TensorRT-Model-Optimizer/ - https://github.com/huggingface/nn_pruning 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
Add support for loading models optimized with QAT, pruning, and sparsity techniques.
Closes #115
New Config Classes
Supported Formats
producer+quantizationfieldsquantization_config.quant_methodpruned_headsfieldsparsity_config.patternUsage Example
Test plan
Future Work (out of scope for this PR)
🤖 Generated with Claude Code