Skip to content

Conversation

@kylesayrs
Copy link
Collaborator

@kylesayrs kylesayrs commented Nov 20, 2025

Purpose

  • Reduce calibration runtime by providing users with the ability to control the calibration batch size
  • In the future, multi-gpu calibration can be enabled using torch.distributed tensor parallelism

Prerequisites

Changes

  • Add batch_size argument
  • Adjust data_collator default to be DataCollatorWithPadding
    • This means that text datasets can be collated without extra work
  • Update vision model examples to use a real data collator
    • Most vision processors are like text processors, except that they add an extra batch dim (for some reason) that needs to be stripped
    • Models which resize all images to the same sizes are automatically handled by DataCollatorWithPadding
    • Models which handle images of different sizes must either batch during dataset processing, or else not handle BS > 1

TODO

  1. Demonstrate throughput increase from batching
  2. Test that all modifiers work with batched samples
  3. Test that all modifiers work with padded samples

@github-actions
Copy link

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@kylesayrs kylesayrs force-pushed the kylesayrs/batched-calibration branch from 32de48f to 35a0507 Compare December 2, 2025 01:09
@kylesayrs kylesayrs changed the base branch from main to kylesayrs/modifiers-expose-targets December 2, 2025 01:10
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@kylesayrs kylesayrs force-pushed the kylesayrs/modifiers-expose-targets branch from 34814c7 to 6559de0 Compare December 2, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants