Skip to content

Qualcomm AI Engine Direct - Fixed the bug in dummy_llama2 script #2587

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

Closed
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
19 changes: 5 additions & 14 deletions examples/qualcomm/scripts/dummy_llama2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import os
import re
import sys
from multiprocessing.connection import Client

import numpy as np
Expand Down Expand Up @@ -71,20 +72,6 @@ def create_device_inputs(example_inputs, use_kv_cache):
default="8a8w",
)

# QNN_SDK_ROOT might also be an argument, but it is used in various places.
# So maybe it's fine to just use the environment.
if "QNN_SDK_ROOT" not in os.environ:
raise RuntimeError("Environment variable QNN_SDK_ROOT must be set")
print(f"QNN_SDK_ROOT={os.getenv('QNN_SDK_ROOT')}")

if "LD_LIBRARY_PATH" not in os.environ:
print(
"[Warning] LD_LIBRARY_PATH is not set. If errors like libQnnHtp.so "
"not found happen, please follow setup.md to set environment."
)
else:
print(f"LD_LIBRARY_PATH={os.getenv('LD_LIBRARY_PATH')}")

args = parser.parse_args()

# ensure the working directory exist.
Expand Down Expand Up @@ -120,6 +107,10 @@ def create_device_inputs(example_inputs, use_kv_cache):
custom_annotations=(),
quant_dtype=quant_dtype,
)

if args.compile_only:
sys.exit(0)

adb = SimpleADB(
qnn_sdk=os.getenv("QNN_SDK_ROOT"),
artifact_path=f"{args.build_folder}",
Expand Down