Skip to content

[Executorch][CI] Fix qnn runner ci job scripts #7049

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
wants to merge 3 commits into from

Conversation

kimishpatel
Copy link
Contributor

@kimishpatel kimishpatel commented Nov 23, 2024

Stack from ghstack (oldest at bottom):

QNN backend's AOT artifacts were being copied in the source directory instead of
them being installed, as build artifacts, in appropriate package directory.

As a result we had to use PYTHON_PATH=".." in test_llama.sh CI script when
running CI for qnn. This results in executorch having two locations as where
the package is installed. This PR fixes that.

Differential Revision: D66406274

QNN backend's AOT artifacts were being copied in the source directory instead of
them being installed, as build artifacts, in appropriate package directory.

As a result we had to use PYTHON_PATH=".." in test_llama.sh CI script when
running CI for qnn. This results in executorch having two locations as where
the package is installed. This PR fixes that.

Differential Revision: [D66406274](https://our.internmc.facebook.com/intern/diff/D66406274/)

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Nov 23, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7049

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Merge Blocking SEVs

There is 1 active merge blocking SEVs. Please view them below:

If you must merge, use @pytorchbot merge -f.

❌ 10 New Failures, 1 Cancelled Job

As of commit 51523e8 with merge base 43555d2 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66406274

QNN backend's AOT artifacts were being copied in the source directory instead of
them being installed, as build artifacts, in appropriate package directory.

As a result we had to use PYTHON_PATH=".." in test_llama.sh CI script when
running CI for qnn. This results in executorch having two locations as where
the package is installed. This PR fixes that.

Differential Revision: [D66406274](https://our.internmc.facebook.com/intern/diff/D66406274/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66406274

QNN backend's AOT artifacts were being copied in the source directory instead of
them being installed, as build artifacts, in appropriate package directory.

As a result we had to use PYTHON_PATH=".." in test_llama.sh CI script when
running CI for qnn. This results in executorch having two locations as where
the package is installed. This PR fixes that.

Differential Revision: [D66406274](https://our.internmc.facebook.com/intern/diff/D66406274/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66406274

@kimishpatel
Copy link
Contributor Author

I am gonna have to abandon this because imports of model in qnn backend think that examples are part of the pip package of executorch. And to get around that we need to do PYTHON_PATH="EXECUTORCH_ROOT". I really dont like it, but dont have bandwidth to figure out better solution. So I will work around it for the purpose of this stack. cc: @cccclai @larryliu0820

@cccclai
Copy link
Contributor

cccclai commented Nov 24, 2024

@kimishpatel hmm how does this stack affect qnn CI job?

@kimishpatel
Copy link
Contributor Author

@kimishpatel hmm how does this stack affect qnn CI job?

Not directly, but now we are importing quantized_kv_cache unconditionally from export_llama_lib. Because qnn CI stack has 1) PYTHON_PATH=.. which affects python imports and confuses the location of where executorch package is installed and 2) various models in examples/backends/qualcomm treat examples folder (as in import executorch.example.models..) as part of executorch pip package, but we pip install of executorch does not include those, so we have to reply on PYTHON_PATH.

2 in particularly is problematic because I see that pattern in a few places but it is not clear if examples is supposed be part of pip package. @larryliu0820 should confirm

@larryliu0820
Copy link
Contributor

@kimishpatel hmm how does this stack affect qnn CI job?

Not directly, but now we are importing quantized_kv_cache unconditionally from export_llama_lib. Because qnn CI stack has 1) PYTHON_PATH=.. which affects python imports and confuses the location of where executorch package is installed and 2) various models in examples/backends/qualcomm treat examples folder (as in import executorch.example.models..) as part of executorch pip package, but we pip install of executorch does not include those, so we have to reply on PYTHON_PATH.

2 in particularly is problematic because I see that pattern in a few places but it is not clear if examples is supposed be part of pip package. @larryliu0820 should confirm

Ideally we shouldn’t include examples in pip package. Anything reusable should go into extension.Ilm and should not tied to any specific model. For example I’m aware a lot of code useful for llama are still in examples.models.llama. They should really go inside extension.llm for reusability

@kimishpatel
Copy link
Contributor Author

llama

There much more widepsread use of pattern from executorch.examples.... failures in this particular case are from from executorch.examples.qualcomm and were resolved by use of PYTHON_PATH in the past. But the way it was setup was causing executorch package directory to be listed as both source as well as what is in site-packages

@cccclai
Copy link
Contributor

cccclai commented Jun 6, 2025

Seems stale

@cccclai cccclai closed this Jun 6, 2025
kedarnath03 pushed a commit to kedarnath03/executorch that referenced this pull request Jun 25, 2025
Pull Request resolved: pytorch/executorch#7049

QNN backend's AOT artifacts were being copied in the source directory instead of
them being installed, as build artifacts, in appropriate package directory.

As a result we had to use PYTHON_PATH=".." in test_llama.sh CI script when
running CI for qnn. This results in executorch having two locations as where
the package is installed. This PR fixes that.
ghstack-source-id: 255154890
@exported-using-ghexport

Differential Revision: [D66406274](https://our.internmc.facebook.com/intern/diff/D66406274/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants