Skip to content

Commit 1fd68d9

Browse files
committed
apply copilot
Signed-off-by: fishbell <[email protected]>
1 parent c16b50b commit 1fd68d9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/cpp/src/continuous_batching/pipeline.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extract_eagle3_mode_from_config(ov::AnyMap& config, const std::filesystem::path&
6060
// If you wish to use different layers, provide the "hidden_layers_list" parameter in the config.
6161
eagle_rt_info.hidden_layers_list = { 2, num_decoder_layers / 2, num_decoder_layers - 3 };
6262
}
63-
OPENVINO_ASSERT(eagle_rt_info.hidden_layers_list.size() == 3, "only exact 3 layer extraction are expected in eagle3");
63+
OPENVINO_ASSERT(eagle_rt_info.hidden_layers_list.size() == 3, "only exactly 3 layer extraction are expected in eagle3");
6464
}
6565
return eagle_rt_info;
6666
}
@@ -91,7 +91,7 @@ ContinuousBatchingPipeline::ContinuousBatchingPipeline( const std::filesystem::p
9191
auto properties_without_draft_model = properties;
9292
auto draft_model_desr = utils::extract_draft_model_from_config(properties_without_draft_model);
9393
auto is_prompt_lookup_enabled = extract_prompt_lookup_from_config(properties_without_draft_model);
94-
auto eagle_rt_info = extract_eagle_mode_from_config(draft_model_desr.properties, models_path);
94+
auto eagle_rt_info = extract_eagle3_mode_from_config(draft_model_desr.properties, models_path);
9595

9696
auto model = utils::read_model(models_path, properties);
9797
auto [properties_without_draft_model_without_gguf, enable_save_ov_model] = utils::extract_gguf_properties(properties_without_draft_model);
@@ -138,7 +138,7 @@ ContinuousBatchingPipeline::ContinuousBatchingPipeline(
138138
auto properties_without_draft_model = properties;
139139
auto draft_model_desr = utils::extract_draft_model_from_config(properties_without_draft_model);
140140
auto is_prompt_lookup_enabled = extract_prompt_lookup_from_config(properties_without_draft_model);
141-
auto eagle_rt_info = extract_eagle_mode_from_config(draft_model_desr.properties, models_path);
141+
auto eagle_rt_info = extract_eagle3_mode_from_config(draft_model_desr.properties, models_path);
142142
auto model = utils::read_model(models_path, properties_without_draft_model);
143143
auto [properties_without_draft_model_without_gguf, enable_save_ov_model] = utils::extract_gguf_properties(properties_without_draft_model);
144144
properties_without_draft_model_without_gguf[ov::cache_model_path.name()] = models_path;
@@ -188,7 +188,7 @@ ContinuousBatchingPipeline::ContinuousBatchingPipeline(
188188
auto properties_without_draft_model = properties;
189189
auto draft_model_desr = utils::extract_draft_model_from_config(properties_without_draft_model);
190190
auto is_prompt_lookup_enabled = extract_prompt_lookup_from_config(properties_without_draft_model);
191-
auto eagle_rt_info = extract_eagle_mode_from_config(draft_model_desr.properties, std::filesystem::path(model_str));
191+
auto eagle_rt_info = extract_eagle3_mode_from_config(draft_model_desr.properties, std::filesystem::path(model_str));
192192
auto model = utils::singleton_core().read_model(model_str, weights_tensor);
193193

194194
auto rt_info = model->get_rt_info();

src/cpp/src/speculative_decoding/continuous_batching_for_speculative_decoding_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ ContinuousBatchingPipeline::ContinuousBatchingForSpeculativeDecodingImpl::update
318318
size_t generated_len = request->get_context_len() >= request->get_prompt_len() ? request->get_context_len() - request->get_prompt_len() + 1 : 0;
319319
if (validate_length > 0) {
320320
if (generated_len > 0) {
321+
// in eagle3 speculative mode, to rewind the processed tokens num to the stable kv position
321322
request->update_processed_tokens_num(num_processed_tokens - result.removed_tokens_cnt + 1 - (validate_length - 1));
322323
}
323324
} else { // fast draft or main model for eagle speculative

tests/python_tests/test_continuous_batching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ def run_extended_perf_metrics_collection(
573573
model_path = download_and_convert_model(model_id).models_path
574574
draft_model_path = None
575575
if draft_model_id is not None:
576-
_,_, draft_model_path = download_and_convert_model(draft_model_id)
576+
draft_model_path = download_and_convert_model(draft_model_id)
577577
ov_pipe = create_ov_pipeline(model_path, pipeline_type=pipeline_type, draft_model_path = draft_model_path)
578578
return ov_pipe.generate([prompt], generation_config).extended_perf_metrics
579579

@@ -585,7 +585,7 @@ def run_extended_perf_metrics_collection(
585585
ignore_eos=True,
586586
num_assistant_tokens=5,
587587
)
588-
if draft_model_id is None:
588+
if draft_model_id is None:
589589
extended_perf_metrics = run_extended_perf_metrics_collection(
590590
main_model_id, generation_config, prompt, pipeline_type, draft_model_id
591591
)

0 commit comments

Comments
 (0)