Skip to content

Add _get_dummy_inputs_for_model helper for quantization tests#13540

Open
jiqing-feng wants to merge 3 commits intohuggingface:mainfrom
jiqing-feng:torchao-fix-input-dtype
Open

Add _get_dummy_inputs_for_model helper for quantization tests#13540
jiqing-feng wants to merge 3 commits intohuggingface:mainfrom
jiqing-feng:torchao-fix-input-dtype

Conversation

@jiqing-feng
Copy link
Copy Markdown
Contributor

What does this PR do?

Introduces _get_dummy_inputs_for_model(model) helper in both QuantizationTesterMixin and QuantizationCompileTesterMixin to automatically cast floating-point input tensors to the model's parameter dtype, preventing dtype mismatches during quantized model inference.

@github-actions github-actions Bot added tests size/S PR with diff < 50 LOC and removed size/S PR with diff < 50 LOC labels Apr 22, 2026
Introduce helper that casts floating-point input tensors to the model's
parameter dtype, preventing dtype mismatches during quantized model inference.
@jiqing-feng jiqing-feng force-pushed the torchao-fix-input-dtype branch from 0bf81b5 to adffdbd Compare April 22, 2026 01:55
@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/S PR with diff < 50 LOC labels Apr 22, 2026
@github-actions github-actions Bot added size/M PR with diff < 200 LOC and removed size/M PR with diff < 200 LOC labels Apr 22, 2026
@github-actions github-actions Bot added size/S PR with diff < 50 LOC and removed size/M PR with diff < 200 LOC labels Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S PR with diff < 50 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant