Skip to content
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

:neckbeard: QNN toolkit #874

Merged
merged 15 commits into from
Jan 18, 2024
Merged

:neckbeard: QNN toolkit #874

merged 15 commits into from
Jan 18, 2024

Conversation

trajepl
Copy link
Contributor

@trajepl trajepl commented Jan 11, 2024

Describe your changes

QNN toolkit

CI e2e test for qnn mobile net: https://github.com/microsoft/Olive/pull/874/checks?check_run_id=20488489220

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

@guotuofeng
Copy link
Collaborator

not checkin the binray files such .raw

output_model_path: str,
) -> QNNModelHandler:
main_cmd = "qnn-context-binary-generator"
runner = QNNSDKRunner(dev=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's meaning dev=True for all cases?

Copy link
Contributor Author

@trajepl trajepl Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev=True means run the cmd locally. Run QNN optimization has following steps:

  1. convert and build model in x64 windows/linux (dev = True
  2. send the model to target devices(arm-windows or android) (dev=False

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is used for run locally or remotely, suggest to change the name to local_run or something else.

In my mind, dev=True means run the optimization using the local branch Olive bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with optional_local_run where the True value is used to tell current runner can run cmd locally.
The value is set to False only if the cmd have to be run remotely but cannot in local env.

@trajepl trajepl marked this pull request as ready for review January 12, 2024 13:30
if not model_paths:
raise FileNotFoundError(f"No model file found in {model_folder}")
elif len(model_paths) > 1:
raise RuntimeError(f"Multiple model files found in {model_folder}: {model_paths}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the optimization pass since the RuntimeError will be ignored? or need we raise assertionerror so the optimization will fail?

Copy link
Contributor Author

@trajepl trajepl Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. Updated both cases with assertion.
image

@trajepl trajepl merged commit 8e2890c into main Jan 18, 2024
32 checks passed
@trajepl trajepl deleted the jiapli/qnn_toolkit branch January 18, 2024 02:38
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.

None yet

3 participants