feat(token_compressor): introduce universal pruning framework and ali…#238
Open
YF-T wants to merge 4 commits intoTencent:mainfrom
Open
feat(token_compressor): introduce universal pruning framework and ali…#238YF-T wants to merge 4 commits intoTencent:mainfrom
YF-T wants to merge 4 commits intoTencent:mainfrom
Conversation
…gn with Transformers v5.0 Major update to the token compression module, introducing a metadata-driven architecture for visual token pruning and merging. This refactor aligns model wrappers with Transformers v5.0 standards to ensure future-proof compatibility and cleaner activation propagation. Key changes: - Integrated UniversalPruningAdapter: A metadata-driven engine that dynamically wraps model components (CLIP/Llama/Qwen) based on YAML mappings. - Implemented PruningContext with Dynamic Synchronization: Added support for negative indexing and property setters to automatically sync layer counts. - Added Comprehensive Algorithm Suite: Integrated SOTA strategies including IDPruner (MMR), VisionZip, VisPruner, SCOPE, HiPrune, and FastV. - Modular Model Support: Added dedicated prunable wrappers for Qwen2.5-VL and LLaVA-1.5. - Transformers v5.0 Alignment: Refactored forward pass logic to use **kwargs propagation for context passing. - Enhanced Evaluation Pipeline: Created run_pruning_eval.py and test_universal_pruning.py for automated benchmarking. - Added comprehensive YAML strategy library in configs/ for Qwen and LLaVA. Copyright 2026 Tencent Inc. All Rights Reserved.
- Add IDPruner core algorithm section with benchmark results - Add baseline pruning methods and evaluation guide - Update installation guide with multimodal and lmms-eval dependencies - Add developer guide for creating custom pruning strategies
yghstill
reviewed
Feb 7, 2026
| @classmethod | ||
| def from_yaml(cls, path: str) -> "TokenCompressorConfig": | ||
| """ | ||
| 解析 YAML 配置文件并返回结构化的 TokenCompressorConfig 对象。 |
angelslim/__init__.py
Outdated
| # limitations under the License. | ||
|
|
||
| from .engine import Engine # noqa: F401 | ||
| # from .engine import Engine # noqa: F401 |
| @@ -0,0 +1,35 @@ | |||
| #!/bin/bash | |||
Collaborator
There was a problem hiding this comment.
scripts/pruning/eval_qwen2_5_vl_visionzip_r0.9.sh是个空文件?
yghstill
approved these changes
Feb 9, 2026
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.
…gn with Transformers v5.0
Major update to the token compression module, introducing a metadata-driven architecture for visual token pruning and merging. This refactor aligns model wrappers with Transformers v5.0 standards to ensure future-proof compatibility and cleaner activation propagation.
Key changes:
Copyright 2026 Tencent Inc. All Rights Reserved.