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

Change default batch #32

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct SchedulerConfig {
// a maximum number of tokens to batch
// (in constrast to max_batch_size which combines independent sequences, we consider total amount of tokens in a batch)
// TODO: benchmark this value and understand a required value to ensure inference is not memory bound
std::size_t max_num_batched_tokens = 16;
std::size_t max_num_batched_tokens = 256;

// total number of KV blocks available to scheduler logic
std::size_t num_kv_blocks = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ void GenerationConfig::validate() const {
OPENVINO_ASSERT(min_new_tokens <= max_new_tokens, "min_new_tokens must be less or equal max_new_tokens");
OPENVINO_ASSERT(min_new_tokens >= 0, "min_new_tokens must be greater 0");
OPENVINO_ASSERT(max_new_tokens >= 0, "max_new_tokens must be greater 0");
if (is_multinomial()) {
OPENVINO_ASSERT(top_p > 0.0f && top_p <= 1.0f, "top_p must be in the interval (0, 1]");
OPENVINO_ASSERT(temperature >= 0.0f, "temperature must be a positive value");
if (is_beam_search()) {
OPENVINO_ASSERT(no_repeat_ngram_size > 0, "no_repeat_ngram_size must be positive");
} else {
OPENVINO_ASSERT(repetition_penalty >= 0.0f, "repetition penalty must be a positive value");
OPENVINO_ASSERT(frequence_penalty >= -2.0f && frequence_penalty <= 2.0f, "frequence_penalty penalty must be a [-2; +2]");
OPENVINO_ASSERT(presence_penalty >= -2.0f && presence_penalty <= 2.0f, "presence_penalty penalty must be a [-2; +2]");
}

if (is_beam_search()) {
OPENVINO_ASSERT(no_repeat_ngram_size > 0, "no_repeat_ngram_size must be positive");
if (is_multinomial()) {
OPENVINO_ASSERT(top_p > 0.0f && top_p <= 1.0f, "top_p must be in the interval (0, 1]");
OPENVINO_ASSERT(temperature >= 0.0f, "temperature must be a positive value");
}
}
}

Expand Down
Loading