Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whisper pipeline: use Sampler #1615

Merged
merged 35 commits into from
Jan 24, 2025

Conversation

as-suvorov
Copy link
Contributor

@as-suvorov as-suvorov commented Jan 22, 2025

Ticket: 152889
Closes #1164

@as-suvorov as-suvorov added this to the 2025.1 milestone Jan 22, 2025
@github-actions github-actions bot added category: continuous batching Continuous batching category: LLM LLM pipeline (stateful, static) category: whisper Whisper pipeline category: sampling Sampling / Decoding algorithms labels Jan 22, 2025
@github-actions github-actions bot added the category: samples GenAI samples label Jan 23, 2025
@github-actions github-actions bot removed the category: samples GenAI samples label Jan 23, 2025
@as-suvorov as-suvorov requested a review from Wovchena January 23, 2025 10:08
@as-suvorov as-suvorov marked this pull request as ready for review January 23, 2025 10:09
src/cpp/src/sampler.cpp Outdated Show resolved Hide resolved
src/cpp/src/sampler.cpp Outdated Show resolved Hide resolved
src/cpp/src/whisper/models/decoder.cpp Show resolved Hide resolved
}
}

std::pair<ov::genai::EncodedResults, bool> decode(std::shared_ptr<ov::genai::WhisperDecoder> decoder,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
std::pair<ov::genai::EncodedResults, bool> decode(std::shared_ptr<ov::genai::WhisperDecoder> decoder,
std::pair<ov::genai::EncodedResults, bool> decode(const std::shared_ptr<ov::genai::WhisperDecoder>& decoder,

const ov::Tensor& encoder_hidden_state,
const std::shared_ptr<ov::genai::StreamerBase> streamer_ptr,
ov::genai::Sampler& sampler,
ov::genai::SequenceGroup::Ptr sequence_group,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ov::genai::SequenceGroup::Ptr sequence_group,
const ov::genai::SequenceGroup::Ptr& sequence_group,

const float* logits_data = logits.data<const float>() + batch_offset + sequence_offset;

int64_t out_token = std::max_element(logits_data, logits_data + vocab_size) - logits_data;
float max_logit = logits_data[out_token];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
float max_logit = logits_data[out_token];

Not used

top_p: if set to float < 1, only the smallest set of most probable tokens with probabilities that add up to top_p or higher are kept for generation.
top_k: the number of highest probability vocabulary tokens to keep for top-k-filtering.
do_sample: whether or not to use multinomial random sampling that add up to `top_p` or higher are kept.
num_return_sequences: the number of sequences to generate from a single prompt.
Copy link
Collaborator

Choose a reason for hiding this comment

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

rng_seed is missing. Although it's not Whisper's fault because it's missing in the parent config as well. Can you add it, possible in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do

@Wovchena Wovchena added this pull request to the merge queue Jan 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 24, 2025
@ilya-lavrenov ilya-lavrenov added this pull request to the merge queue Jan 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 24, 2025
@ilya-lavrenov ilya-lavrenov added this pull request to the merge queue Jan 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 24, 2025
@as-suvorov as-suvorov enabled auto-merge January 24, 2025 13:09
@as-suvorov as-suvorov added this pull request to the merge queue Jan 24, 2025
Merged via the queue into openvinotoolkit:master with commit 42b16e5 Jan 24, 2025
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: continuous batching Continuous batching category: GenAI C++ API Changes in GenAI C++ public headers category: LLM LLM pipeline (stateful, static) category: Python API Python API for GenAI category: sampling Sampling / Decoding algorithms category: whisper Whisper pipeline no-match-files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Enable Beam Search in WhisperPipeline to Enhance Transcription Accuracy
3 participants