Skip to content

Commit fee79fe

Browse files
authored
Update use tensor data member (#2978)
## Description - Remove dead code which cause compilation error with updated ov::Tensor::data() member. for OV 26.0 to fix build issues. - No test update, functionality not changed. - No docs update required. Blocked PR: - openvinotoolkit/openvino#32569 <!--- Jira ticket number (e.g., 123). Delete if there's no ticket. Don't include full link or project name. --> Ticket: CVS-174872 ## Checklist: - [x] Tests have been updated or added to cover the new code <!--- If the change isn't maintenance related, update the tests at https://github.com/openvinotoolkit/openvino.genai/tree/master/tests or explain in the description why the tests don't need an update. --> - [x] This patch fully addresses the ticket. <!--- If follow-up pull requests are needed, specify in description. --> - [x] I have made corresponding changes to the documentation --------- Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com>
1 parent d0328ba commit fee79fe

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/cpp/src/sequence_group.hpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ class Sequence {
237237
m_position_ids_list.push_back(position_ids);
238238
return;
239239
}
240-
int64_t* position_ids_data = position_ids.data<int64_t>();
241240
ov::Shape position_ids_elem_shape = position_ids.get_shape();
242241
position_ids_elem_shape[seq_len_shape_idx] = 1;
243242

@@ -317,7 +316,7 @@ class SequenceGroup : public std::enable_shared_from_this<SequenceGroup> {
317316
SequenceGroupType m_sequence_group_type;
318317

319318
uint64_t m_next_sequence_id = 0;
320-
319+
321320
// amount of processed tokens, e.g. prompt can be processed using multiple consequence inferences
322321
// so, we need to track which part of the prompt we have already processed
323322
size_t m_num_processed_tokens = 0;
@@ -358,12 +357,12 @@ class SequenceGroup : public std::enable_shared_from_this<SequenceGroup> {
358357
: SequenceGroup(request_id, ov::Tensor(ov::element::i64, ov::Shape{input_ids.size()}, (void *)input_ids.data()), sampling_params, block_size, std::nullopt) {
359358
}
360359

361-
SequenceGroup(uint64_t request_id,
362-
const ov::Tensor& input_ids,
363-
const ov::genai::GenerationConfig& sampling_params,
364-
std::size_t block_size,
365-
const std::optional<ov::Tensor>& token_type_ids = std::nullopt,
366-
const std::optional<ov::Tensor>& position_ids = std::nullopt,
360+
SequenceGroup(uint64_t request_id,
361+
const ov::Tensor& input_ids,
362+
const ov::genai::GenerationConfig& sampling_params,
363+
std::size_t block_size,
364+
const std::optional<ov::Tensor>& token_type_ids = std::nullopt,
365+
const std::optional<ov::Tensor>& position_ids = std::nullopt,
367366
const std::optional<int64_t>& rope_delta = std::nullopt)
368367
: SequenceGroup(request_id, sampling_params, block_size) {
369368
size_t prompt_len;
@@ -405,7 +404,7 @@ class SequenceGroup : public std::enable_shared_from_this<SequenceGroup> {
405404
m_prompt_log_probs.reserve(prompt_len);
406405

407406
auto sequence = Sequence::create(m_next_sequence_id++, m_sequence_group_type, hidden_size);
408-
407+
409408
if (position_ids.has_value()) {
410409
sequence->append_position_ids(*position_ids);
411410
}
@@ -647,7 +646,7 @@ class SequenceGroup : public std::enable_shared_from_this<SequenceGroup> {
647646
size_t get_num_tokens_to_validate() {
648647
return m_num_validation_tokens;
649648
}
650-
649+
651650
void set_stream_window_size(size_t k) {
652651
m_stream_window_size = k;
653652
}
@@ -863,7 +862,7 @@ class SequenceGroup : public std::enable_shared_from_this<SequenceGroup> {
863862
}
864863
}
865864

866-
865+
867866
// Special notification path for max_new_tokens == 0 where we don't expect to return any new tokens, but only process prompt
868867
void notify_handle_echo_only() {
869868
// This method is called after scheduling and before sampling,

0 commit comments

Comments
 (0)