Skip to content
Merged
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
31 changes: 30 additions & 1 deletion backends/qualcomm/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,38 @@ def validate_intermediate_tensor():
# ok, assuming the user give a relative path to cwd
build_folder = os.path.join(os.getcwd(), self.build_folder)

env_runner = os.environ.get("QNN_EXECUTOR_RUNNER")
runner_from_env = bool(env_runner and env_runner.strip())
if runner_from_env:
qnn_executor_runner = os.path.abspath(env_runner.strip())
else:
qnn_executor_runner = os.path.join(
build_folder,
"examples/qualcomm/executor_runner/qnn_executor_runner",
)
Comment thread
psiddh marked this conversation as resolved.
if not os.path.isfile(qnn_executor_runner):
if runner_from_env:
raise FileNotFoundError(
f"QNN_EXECUTOR_RUNNER is set to {qnn_executor_runner!r} "
"but no file exists at that path. Update the "
"environment variable to point at the built "
"qnn_executor_runner binary."
)
Comment thread
psiddh marked this conversation as resolved.
raise FileNotFoundError(
f"qnn_executor_runner not found at {qnn_executor_runner!r}. "
"Set the QNN_EXECUTOR_RUNNER environment variable to the "
"built binary, or build it via CMake so it appears at "
f"{build_folder}/examples/qualcomm/executor_runner/qnn_executor_runner."
)
if not os.access(qnn_executor_runner, os.X_OK):
raise PermissionError(
f"{qnn_executor_runner!r} exists but is not executable. "
"Run `chmod +x` on the binary or rebuild it."
)

cmd = [
# qnn_executor_runner
f"{build_folder}/examples/qualcomm/executor_runner/qnn_executor_runner",
qnn_executor_runner,
"--model_path",
pte_fname,
"--input_list_path",
Expand Down
Loading