feat: add overlap function for multi-blocks compression#1850
Conversation
There was a problem hiding this comment.
Pull request overview
Adds overlap support for multi-block compression/tuning so adjacent block windows can share a configurable number of blocks, aiming to improve continuity during calibration.
Changes:
- Introduce
--nblocks_overlap/nblocks_overlapconfiguration and validate it (0 <= nblocks_overlap < nblocks). - Implement overlap-aware block-window iteration and progress accounting.
- Add logic to compute “stride” outputs for the next window and snapshot/restore overlapped tail blocks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| auto_round/compressors/data_driven.py | Implements overlap window iteration, stride-based next-input selection, and tail snapshot/restore helpers. |
| auto_round/compressors/config.py | Plumbs nblocks_overlap through extra config/dataclass. |
| auto_round/compressors/base.py | Parses nblocks_overlap and enforces basic validity constraints. |
| auto_round/main.py | Adds the --nblocks_overlap CLI flag and forwards it into tuning config. |
|
as discussed offline, the implementation probably has bugs from algorithm perspective |
|
10 tasks acc_norm W2A16
W4A16
|
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
as overlapping will cause 2X cost, comparing it with baseline directly is not very fair. So please comparing yours with iters x N, e.g., comparing n2o1 with iters 400 and n4o3 with iters 800. |
b62b167 to
de3a0c1
Compare
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Add an opt-in nblocks_overlap parameter so adjacent multi-block windows can share blocks during compression. Windows advance by stride = nblocks - overlap; shared (overlap) blocks keep an FP snapshot and are restored + re-tuned with more context in the next window, while only the leading stride blocks are finalized each window. The next window's cache is advanced by the partial output of the finalized sub-blocks. When nblocks_overlap == 0 (default) the schedule and behavior are identical to the existing non-overlapping path, so existing behavior/tests are unaffected. Plumbed through SignRoundConfig, the CLI (--nblocks_overlap), the new entry config kwargs, and the legacy AutoRound compat kwargs. Signed-off-by: ZaneMark <zaner.ma@intel.com>
99a4623 to
bceb9b8
Compare
|
/azp run Unit-Test-CUDA-AutoRound |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Introducing overlap support for multi-block compression, enabling overlapping block windows during tuning.
Motivation:
Key changes:
--nblocks_overlapto control overlap between adjacent block windowsType of Change
New feature
Checklist Before Submitting
/azp run Unit-Test-CUDA-AutoRound.To Do
Outcome
Qwen3-8B
Llama-3.1-8B-Instruct