@@ -43,9 +43,10 @@ ::executorch::runtime::Result<uint64_t> TextPrefiller::prefill(
43
43
{1 , num_prompt_tokens},
44
44
exec_aten::ScalarType::Long);
45
45
46
- auto start_pos = from_blob (&start_pos, {1 }, exec_aten::ScalarType::Long);
46
+ auto start_pos_tensor =
47
+ from_blob (&start_pos, {1 }, exec_aten::ScalarType::Long);
47
48
48
- auto outputs_res = text_decoder_runner_->step (tokens, start_pos );
49
+ auto outputs_res = text_decoder_runner_->step (tokens, start_pos_tensor );
49
50
50
51
ET_CHECK_OK_OR_RETURN_ERROR (outputs_res.error ());
51
52
ET_LOG (
@@ -61,12 +62,13 @@ ::executorch::runtime::Result<uint64_t> TextPrefiller::prefill(
61
62
// initialize tensor wrappers
62
63
auto tokens = from_blob (&cur_token, {1 , 1 }, exec_aten::ScalarType::Long);
63
64
64
- auto start_pos = from_blob (&start_pos, {1 }, exec_aten::ScalarType::Long);
65
+ auto start_pos_tensor =
66
+ from_blob (&start_pos, {1 }, exec_aten::ScalarType::Long);
65
67
66
68
// run the first token and get back logits tensor. Assuming the first token
67
69
// is bos so don't callback.
68
70
auto logits_tensor =
69
- ET_UNWRAP (text_decoder_runner_->step (tokens, start_pos ));
71
+ ET_UNWRAP (text_decoder_runner_->step (tokens, start_pos_tensor ));
70
72
71
73
pos += 1 ; // start the loop from index 1
72
74
start_pos += 1 ;
@@ -76,7 +78,8 @@ ::executorch::runtime::Result<uint64_t> TextPrefiller::prefill(
76
78
// NOLINTNEXTLINE(facebook-hte-ParameterUncheckedArrayBounds)
77
79
cur_token = prompt_tokens[pos];
78
80
79
- logits_tensor = ET_UNWRAP (text_decoder_runner_->step (tokens, start_pos));
81
+ logits_tensor =
82
+ ET_UNWRAP (text_decoder_runner_->step (tokens, start_pos_tensor));
80
83
81
84
pos++;
82
85
start_pos++;
0 commit comments