Skip to content
Open
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
3 changes: 2 additions & 1 deletion runtime/executor/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ cc_library(
"@litert//litert/cc:litert_model",
"@litert//litert/cc:litert_ranked_tensor_type",
"//runtime/components:model_resources",
"//runtime/proto:llm_model_type_cc_proto",
"//runtime/util:litert_status_util",
] + select({
"@platforms//os:ios": [],
Expand All @@ -404,6 +405,7 @@ cc_test(
":llm_executor_settings",
":llm_litert_compiled_model_executor_factory",
"@com_google_googletest//:gtest_main",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@litert//litert/cc:litert_environment",
Expand All @@ -412,7 +414,6 @@ cc_test(
"//runtime/components:model_resources_litert_lm",
"//runtime/util:litert_lm_loader",
"//runtime/util:litert_status_util",
"//runtime/util:model_asset_bundle_resources",
"//runtime/util:scoped_file",
"//runtime/util:test_utils",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "runtime/executor/llm_executor.h"
#include "runtime/executor/llm_executor_settings.h"
#include "runtime/executor/llm_litert_compiled_model_executor.h"
#include "runtime/proto/llm_model_type.pb.h"
#include "runtime/util/status_macros.h"

#if !defined(LITERT_DISABLE_NPU)
Expand Down Expand Up @@ -131,10 +132,11 @@ absl::StatusOr<std::unique_ptr<LlmExecutor>>
CreateCpuOrGpuLlmLiteRtCompiledModelExecutor(
LlmExecutorSettings executor_settings, Environment& lrt_env,
ModelResources& resources) {
std::unique_ptr<LlmExecutor> executor;

ASSIGN_OR_RETURN(const litert::Model* litert_model,
resources.GetTFLiteModel(ModelType::kTfLitePrefillDecode));

std::unique_ptr<LlmExecutor> executor;
ASSIGN_OR_RETURN(bool is_dynamic_model, IsDynamicModel(*litert_model));
if (is_dynamic_model) {
ASSIGN_OR_RETURN(executor, LlmLiteRtCompiledModelExecutorDynamic::Create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/status/status.h" // from @com_google_absl
#include "absl/status/statusor.h" // from @com_google_absl
#include "absl/strings/string_view.h" // from @com_google_absl
#include "litert/cc/litert_environment.h" // from @litert
Expand All @@ -31,7 +32,6 @@
#include "runtime/executor/llm_executor_settings.h"
#include "runtime/util/litert_lm_loader.h"
#include "runtime/util/scoped_file.h"
#include "runtime/util/status_macros.h"
#include "runtime/util/test_utils.h" // IWYU pragma: keep

namespace litert::lm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ absl::Status SerialExecutionManager::AddDecodeTask(
session_info->stop_token_detector->ResetBatch(num_output_candidates);
std::optional<Sampler*> optional_sampler = std::nullopt;
std::optional<litert::TensorBuffer> decoded_ids_buffer = std::nullopt;
if (session_info->sampler != nullptr) {
if (session_info->sampler != nullptr && !is_text_diffusion) {
optional_sampler = session_info->sampler.get();
std::vector<int> decoded_ids(num_output_candidates,
session_info->last_prefill_token_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,8 @@ absl::Status ThreadedExecutionManager::AddDecodeTask(
session_info->stop_token_detector->ResetBatch(num_output_candidates);
std::optional<Sampler*> optional_sampler = std::nullopt;
std::optional<litert::TensorBuffer> decoded_ids_buffer = std::nullopt;
if (session_info->sampler != nullptr) {
bool is_text_diffusion = false;
if (session_info->sampler != nullptr && !is_text_diffusion) {
optional_sampler = session_info->sampler.get();
std::vector<int> decoded_ids(num_output_candidates,
session_info->last_prefill_token_id);
Expand Down
Loading