-
Notifications
You must be signed in to change notification settings - Fork 882
AOT inductor example for cpp backend #2913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d886bff
Include llama2.c as a submodule and just add header file to example i…
mreso ac96344
Add AOTInductor example
mreso fb35caa
Temporarilly point llama2.so to a fork
mreso 22f9814
Move llama2.so back to original repo
mreso 002b902
Move creation of test resources and build files under _build instead …
mreso 32f2415
Move aot_inductor example under llama2 subfolder
mreso c8b35f2
Update aot inductor cpp example docs
mreso b332e00
Merge branch 'master' into feature/cpp_aot_inductor_example
mreso f5888d2
Fix spell checks
mreso 37608a2
Update example description in cpp/README.md
mreso fb4598d
Merge remote-tracking branch 'origin/master' into feature/cpp_aot_ind…
mreso 9406958
Point llama2.so to temporary fork
mreso 5786fc2
Make aot inductor cpp example run with 2.2 instead of nightlies
mreso cfe7bf2
Merge remote-tracking branch 'origin/master' into feature/cpp_aot_ind…
mreso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
|
||
add_subdirectory("../../../examples/cpp/babyllama/" "../../../test/resources/examples/babyllama/babyllama_handler/") | ||
add_subdirectory("../../../examples/cpp/babyllama/" "${CMAKE_CURRENT_BINARY_DIR}/../../test/resources/examples/babyllama/babyllama_handler/") | ||
|
||
add_subdirectory("../../../examples/cpp/llamacpp/" "../../../test/resources/examples/llamacpp/llamacpp_handler/") | ||
if(nightlies) | ||
add_subdirectory("../../../examples/cpp/aot_inductor/llama2/" "${CMAKE_CURRENT_BINARY_DIR}/../../test/resources/examples/aot_inductor/llama_handler/") | ||
endif() | ||
|
||
add_subdirectory("../../../examples/cpp/mnist/" "../../../test/resources/examples/mnist/mnist_handler/") | ||
add_subdirectory("../../../examples/cpp/llamacpp/" "${CMAKE_CURRENT_BINARY_DIR}/../../test/resources/examples/llamacpp/llamacpp_handler/") | ||
|
||
add_subdirectory("../../../examples/cpp/mnist/" "${CMAKE_CURRENT_BINARY_DIR}/../../test/resources/examples/mnist/mnist_handler/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
cpp/test/resources/examples/aot_inductor/llama_handler/MAR-INF/MANIFEST.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"createdOn": "28/07/2020 06:32:08", | ||
"runtime": "LSP", | ||
"model": { | ||
"modelName": "llama", | ||
"handler": "libllama_so_handler:LlamaHandler", | ||
"modelVersion": "2.0" | ||
}, | ||
"archiverVersion": "0.2.0" | ||
} |
4 changes: 4 additions & 0 deletions
4
cpp/test/resources/examples/aot_inductor/llama_handler/config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"checkpoint_path" : "_build/test/resources/examples/aot_inductor/llama_handler/stories15M.so", | ||
"tokenizer_path" : "_build/test/resources/examples/babyllama/babyllama_handler/tokenizer.bin" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello my name is |
4 changes: 2 additions & 2 deletions
4
cpp/test/resources/examples/babyllama/babyllama_handler/config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"checkpoint_path" : "test/resources/examples/babyllama/babyllama_handler/stories15M.bin", | ||
"tokenizer_path" : "test/resources/examples/babyllama/babyllama_handler/tokenizer.bin" | ||
"checkpoint_path" : "_build/test/resources/examples/babyllama/babyllama_handler/stories15M.bin", | ||
"tokenizer_path" : "_build/test/resources/examples/babyllama/babyllama_handler/tokenizer.bin" | ||
} |
3 changes: 3 additions & 0 deletions
3
cpp/test/resources/examples/llamacpp/llamacpp_handler/config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"checkpoint_path" : "_build/test/resources/examples/llamacpp/llamacpp_handler/llama-2-7b-chat.Q5_0.gguf" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
add_library(llama2_so STATIC ../../../../cpp/third-party/llama2.so/run.cpp) | ||
target_compile_options(llama2_so PRIVATE -Wall -Wextra -Ofast -fpermissive) | ||
|
||
add_library(llama_so_handler SHARED src/llama_handler.cc) | ||
target_link_libraries(llama_so_handler PRIVATE llama2_so ts_backends_core ts_utils ${TORCH_LIBRARIES}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.