-
Notifications
You must be signed in to change notification settings - Fork 577
Fix ANE llama export #8904
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
Fix ANE llama export #8904
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
87a3c54
up
metascroy ee6a294
up
metascroy 9ec6231
up
metascroy 0c627f1
up
metascroy 4d4b585
up
metascroy 7b57ae3
up
metascroy 1ba0f20
up
metascroy 74ecaaf
up
metascroy 3733951
up
metascroy 1bb62e3
up
metascroy 030a6b3
up
metascroy c653299
up
metascroy 83ae7aa
up
metascroy 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
# Copyright (c) Qualcomm Innovation Center, Inc. | ||
# All rights reserved | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -exu | ||
|
||
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" | ||
|
||
export EXECUTORCH_ROOT="$(dirname "${BASH_SOURCE[0]}")/../.." | ||
|
||
if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then | ||
PYTHON_EXECUTABLE=python3 | ||
fi | ||
|
||
which "${PYTHON_EXECUTABLE}" | ||
|
||
pushd $EXECUTORCH_ROOT/examples/apple/coreml/llama | ||
|
||
# Download stories llama110m artifacts | ||
download_stories_model_artifacts | ||
|
||
python export.py -n model.pte -p params.json -c stories110M.pt --seq_length 32 --max_seq_length 64 --dtype fp16 --coreml-quantize c4w | ||
|
||
|
||
python run.py -m model.pte -t tokenizer.model --prompt "Once upon a time," --temperature 0.0 &> tmp.txt | ||
tail -n +6 tmp.txt &> output.txt | ||
|
||
cat output.txt | ||
|
||
printf 'Once upon a time,there was a little girl named L ily . She loved to play outside in the sun sh ine . One day , she saw ' &> expected.txt | ||
|
||
|
||
if diff output.txt expected.txt > /dev/null; then | ||
echo "Output matches." | ||
else | ||
echo "Output does not match." | ||
echo "\n\nExpected:" | ||
cat expected.txt | ||
|
||
echo "\n\nGot:" | ||
cat output.txt | ||
|
||
echo "\n\nDiff:" | ||
diff output.txt expected.txt | ||
exit 1 | ||
fi | ||
|
||
popd |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought all the mac jobs are in trunk because of the cost/reliability issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @kirklandsign @huydhn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it true? Maybe just rebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #610, not sure if it's still true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, macos_job ideally should be in trunk.yml and can be run on PR using
ciflow/trunk
. The job could be here is it's important enough to justify running in every pull requests. I assume that this is not the case here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I moved the job to trunk.yml