[Whisper] Fix integration test failures on A10G (dtype, stale values, API changes) (#47995)
* [Whisper] Fix float32/float16 dtype mismatch in integration tests
whisper-large-v3 and distil-large-v3 are now saved as float16 on the Hub.
Tests loaded the model without explicit dtype (loaded as float16) but cast
input_features only to device (stayed float32), causing:
RuntimeError: Input type (float) and bias type (c10::Half) should be the same
Fix: use input_features.to(torch_device, dtype=model.dtype) in 5 tests:
- test_large_generation
- test_large_generation_multilingual
- test_large_batched_generation
- test_distil_token_timestamp_generation
- test_large_timestamp_generation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [Whisper] Update test_large_timestamp_generation expected transcript
batch_decode(output_offsets=True) now returns a plain dict instead of a list,
and offsets is empty when return_timestamps was not set at generation time.
Update EXPECTED_TRANSCRIPT to match current output.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [Whisper] Update test_whisper_shortform_single_batch_prev_cond expected output
CUDA A10G now produces comma-separated transcription ("leather seating, so soft",
"folks, I lurched") vs previous ("seating so soft", "folks. I lurched").
Update cuda_expectation and cuda_expectation2 to match current output.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [Whisper] Fix remaining integration test failures (value mismatches, API changes, static cache)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [Whisper] Clarify static cache reset comment in test_tiny_static_generation_long_form
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [Whisper] Restore truncated eager vs static comparison in test_tiny_static_generation_long_form
torch.compile introduces tiny fp differences that diverge after ~85-138 generated tokens;
compare only the first 40 generated tokens ([:41]) for basic correctness, and keep the
two-static-run comparison to verify cache-reset correctness.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [Whisper] Add PR reference to static generation test comment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* [Whisper] Remove unnecessary min_len in static cache reorder assertion
Both static runs produce equal-length outputs so min_len is not needed;
use a direct full-sequence comparison instead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* format
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com> Y
Yih-Dar committed
16cbed7ee29dc326a25d905902109c1557956c3a
Parent: a61d5f9
Committed by GitHub <noreply@github.com>
on 8/16/2026, 3:28:58 PM