Skip to content
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
9 changes: 4 additions & 5 deletions extension/llm/runner/text_llm_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,6 @@ Error TextLLMRunner::generate(
stats_->first_token_ms = time_in_ms();
stats_->prompt_eval_end_ms = time_in_ms();

RUNNER_ET_LOG(
config.warming,
"RSS after prompt prefill: %f MiB (0 if unsupported)",
get_rss_bytes() / 1024.0 / 1024.0);

// print the first token from prefill. No prev_token so use cur_token for it.
auto decode_result = tokenizer_->decode(cur_token, cur_token);
if (!decode_result.ok()) {
Expand All @@ -190,6 +185,10 @@ Error TextLLMRunner::generate(
return ::executorch::runtime::Error::InvalidArgument;
}
wrapped_callback(std::move(*decode_result));
RUNNER_ET_LOG(
config.warming,
"RSS after prompt prefill: %f MiB (0 if unsupported)",
get_rss_bytes() / 1024.0 / 1024.0);

// start the main loop
prompt_tokens.push_back(cur_token);
Expand Down
6 changes: 1 addition & 5 deletions extension/llm/runner/text_token_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,9 @@ class ET_EXPERIMENTAL TextTokenGenerator {
if (eos_ids_->find(cur_token) != eos_ids_->end()) {
printf("\n");
ET_LOG(Info, "\nReached to the end of generation");
return pos - start_pos;
break;
}
}
ET_LOG(
Info,
"\nFinished generation. Generated %" PRIi32 " tokens.",
start_pos + max_new_tokens);
return pos - start_pos;
}

Expand Down
Loading