Skip to content

Commit 0237dfd

Browse files
committed
Address comments
1 parent 3e349fb commit 0237dfd

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

extension/llm/runner/text_decoder_runner.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,6 @@ ::executorch::runtime::Result<executorch::aten::Tensor> TextDecoderRunner::step(
3737
bool use_kv_cache = method_meta.num_inputs() > 1;
3838

3939
if (use_kv_cache) {
40-
// Size of the second argument. This could be either input_pos or
41-
// cache_positions
42-
43-
// Check if we are using cache positions instead of input pos.
44-
auto second_input_info = ET_UNWRAP(method_meta.input_tensor_meta(1));
45-
// For input_pos, numel is 1, for cache_positions, numel is max_seq_len
46-
auto sizes = second_input_info.sizes();
47-
// Assuming 1D tensor
48-
ET_CHECK_OR_RETURN_ERROR(
49-
sizes.size() == 1,
50-
InvalidProgram,
51-
"The second input tensor is not 1D tensor. Got dimension (%zu)",
52-
sizes.size());
53-
auto numel = sizes[0];
54-
std::vector<::executorch::aten::SizesType> sizes_vec = {numel};
55-
5640
auto start_pos_tensor = ET_UNWRAP(populate_start_pos_or_cache_position(
5741
"forward", module_, start_pos, tokens->numel()));
5842

0 commit comments

Comments
 (0)