Skip to content

Commit

Permalink
Add LlamaRunner (pytorch#1483)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#1483

Added `llama_runner.h/cpp` and enabled ATen mode and portable mode.

Reviewed By: iseeyuan

Differential Revision: D52208223

fbshipit-source-id: fffca45ff3a028e187688bfa61ee242bfb41f06d
  • Loading branch information
larryliu0820 authored and facebook-github-bot committed Dec 23, 2023
1 parent 88cae48 commit 9d9ba29
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extension/runner/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@ Error Runner::loadMethod(const std::string& methodName) {
return Error::Ok;
}

Result<const char*> Runner::getMethodName(size_t methodIndex) const {
return program_->get_method_name(methodIndex);
}

} // namespace torch::executor
2 changes: 2 additions & 0 deletions extension/runner/runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Runner {
const std::vector<EValue>& inputs,
std::vector<EValue>& outputs);

Result<const char*> getMethodName(size_t methodIndex) const;

private:
Error loadMethod(const std::string& methodName);

Expand Down
18 changes: 18 additions & 0 deletions extension/runner/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,21 @@ def define_common_targets():
"//executorch/runtime/executor:program",
],
)

runtime.cxx_library(
name = "runner_aten",
srcs = [
"runner.cpp",
],
exported_headers = [
"runner.h",
],
platforms = ["Default"],
define_static_target = False,
visibility = [
"@EXECUTORCH_CLIENTS",
],
exported_deps = [
"//executorch/runtime/executor:program_aten",
],
)

0 comments on commit 9d9ba29

Please sign in to comment.