Skip to content

[QNN EP] Add cross-device prepare/run/compare subcommands to encryption_test.py - #883

Open
tzuhsuanwei wants to merge 1 commit into
mainfrom
feature/encryption-test-cross-device
Open

tzuhsuanwei wants to merge 1 commit into
mainfrom
feature/encryption-test-cross-device

Conversation

@tzuhsuanwei

@tzuhsuanwei tzuhsuanwei commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • encryption_test.py's one-shot mode requires prepare_app and run_app on the same machine, which cannot work for the UC2 scenario (compile on an x86_64 host with no NPU, run on a separate ARM64 device with real HTP hardware) — the two executables never coexist on one box in that setup.
  • Adds prepare, run, and compare subcommands so each phase can run independently on its own machine, with intermediate files (enc_ctx.onnx, enc_cipher.bin, answer_prepare.raw, answer_run.raw) copied between machines manually (e.g. via scp).
  • The original one-shot behavior is preserved under a new both subcommand for same-machine use — no behavior change for existing callers other than needing to add both as the first argument.
  • Only qcom/samples/ep_context_encryption/encryption_test.py is touched; no other files changed.

Test plan

  • Verified both subcommand reproduces the original round-trip result on a real V81 ARM64 device (PASS: 1000 value(s) within 0.001 (max |diff| = 0.0))
  • Verified prepare → run → compare split produces the identical PASS result when run as three separate invocations
  • python -m py_compile clean

…on_test.py

The one-shot mode requires prepare_app and run_app on the same machine,
which cannot work for the UC2 scenario (compile on an x86_64 host with no
NPU, run on a separate ARM64 device with real HTP hardware) — the two
executables never coexist on one box in that setup.

Add "prepare", "run", and "compare" subcommands so each phase can run
independently on its own machine, with intermediate files (enc_ctx.onnx,
enc_cipher.bin, answer_prepare.raw, answer_run.raw) copied between them
manually (e.g. via scp). The original one-shot behavior is preserved under
a new "both" subcommand for same-machine use.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant