forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ec63be
commit 2beeb13
Showing
7 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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,20 @@ | ||
# TinyLlama | ||
touch TinyLlama-1.1B-Chat-v1.0.txt | ||
for i in {1..10}; do | ||
echo "TinyLlama $i" | ||
python compile_test.py ../genAI/models/TinyLlama-1.1B-Chat-v1.0 | ||
done | ||
|
||
# Llama-2-7b | ||
touch Llama-2-7b-hf.txt | ||
for i in {1..10}; do | ||
echo "Llama-2-7b $i" | ||
python compile_test.py ../genAI/models/Llama-2-7b-hf | ||
done | ||
|
||
# Llama-3-8B | ||
touch Meta-Llama-3-8B-Instruct.txt | ||
for i in {1..10}; do | ||
echo "Llama-3-8B $i" | ||
python compile_test.py ../genAI/models/Meta-Llama-3-8B-Instruct | ||
done |
This file contains 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,34 @@ | ||
import numpy as np | ||
import openvino as ov | ||
import openvino.properties.hint as hints | ||
import openvino.properties as props | ||
import time | ||
import sys | ||
import os | ||
|
||
from transformers import AutoTokenizer | ||
from tqdm import tqdm | ||
|
||
|
||
def main(model_dir): | ||
core = ov.Core() | ||
core.set_property("CPU", {hints.execution_mode: hints.ExecutionMode.PERFORMANCE}) | ||
|
||
config = { | ||
props.inference_num_threads: 64, | ||
hints.inference_precision: "f16", | ||
} | ||
|
||
start = time.time() | ||
model = core.compile_model(model_dir + "/openvino_model.xml", "CPU", config) | ||
end = time.time() | ||
|
||
model_name = os.path.basename(model_dir) | ||
with open(f"{model_name}.txt", "a") as f: | ||
f.writelines(f"{end - start},") | ||
|
||
print(f"{model_name}: {end - start} sec") | ||
|
||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1]) |
Submodule ComputeLibrary
updated
143 files
Submodule onednn_gpu
updated
1450 files