Skip to content

Conversation

danbev
Copy link
Member

@danbev danbev commented Oct 1, 2025

This commit enables the flast_attn context parameter to be set in the Ruby bindings.

The motivation for this is that the default setting for this recently changed to true, which causes the following test to fail:

Failure: test_transcribe_n_processors(TestWhisper):
  </ask not what your country can do for you[,.] ask what you can do for your country/i> was expected to be =~
  <" And so, my fellow Americans! Ask not what you do. what your country can do for you. Ask what you can do for your country.">.

An alternative could also be to change the test.

@ggerganov
Copy link
Member

I think this is OK - not 100% sure about the implementation details as I'm not familiar with Ruby (cc @KitaitiMakoto).

To clarify - the test is failing because it splits the audio in 4 parts and processes them in parallel. And since the audio is very short, it can be expected to have some irregularities in the transcription around the borders where the splits were done. In this case, the "no FA" case happens to be OK and the "FA" case has some irregularities. For another audio, it could be the other way around.

This commit enables the flast_attn context parameter to be set in the
Ruby bindings.

The motivation for this is that the default setting for this recently
changed to true, which causes the following test to fail:
```console
Failure: test_transcribe_n_processors(TestWhisper):
  </ask not what your country can do for you[,.] ask what you can do for your country/i> was expected to be =~
  <" And so, my fellow Americans! Ask not what you do. what your country can do for you. Ask what you can do for your country.">.
```
An alternative could also be to change the test.
@danbev danbev force-pushed the binding-ruby-flash-attention branch from c610672 to 0c2bfd5 Compare October 1, 2025 07:22
Copy link
Collaborator

@KitaitiMakoto KitaitiMakoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danbev @ggerganov
Thank you for patches and details. I think it's better to loose the test because we should accept some non-accurate transcription as we do in cases like parallel transcription.

If you want to add option to set flat_attn, adding Whisper::ContextParams seems right way but it's not too late even after a request comes in.

@KitaitiMakoto
Copy link
Collaborator

I thinks #3448 is enough.

@danbev
Copy link
Member Author

danbev commented Oct 1, 2025

Closing in favor of #3448

@danbev danbev closed this Oct 1, 2025
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.

3 participants