Skip to content

Conversation

@shewu-quic
Copy link
Collaborator

Summary:

  • Support triu
  • The weight node of the linear node was the output of another node rather than being static.
  • Using ctypes.CDLL(xxx, mode=ctypes.RTLD_GLOBAL) is causing unexpected behavior. The issue is still under investigation.
[ERROR] [Qnn ExecuTorch]:  <E> Failed to create InputDef for Op aten_permute_copy_default (qti.aisw::Transpose) param perm

[ERROR] [Qnn ExecuTorch]:  <E> Failed to set the params for the op: Transpose

[ERROR] [Qnn ExecuTorch]:  <E> Failed to construct common node for graph 256

[ERROR] [Qnn ExecuTorch]:  <E> Failed to add node with err 6001

[ERROR] [Qnn ExecuTorch]: Failed to add node to Qnn Graph with error: 6001
[ERROR] [Qnn ExecuTorch]: Fail to compile QNN graph

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 20, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures, 3 Cancelled Jobs

As of commit e5d085e with merge base e0dda90 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

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

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 20, 2025
@cccclai
Copy link
Contributor

cccclai commented Nov 20, 2025

Thank you for putting up the PR! For the change in backends/qualcomm/scripts/download_qnn_sdk.py, does it mean the SDK is from pip wheel package?

@shewu-quic
Copy link
Collaborator Author

Thank you for putting up the PR! For the change in backends/qualcomm/scripts/download_qnn_sdk.py, does it mean the SDK is from pip wheel package?

Yes, I created a new virtual environment and tried to reproduce the error by running pip install executorch.
I found that I couldn't export any graph using it in the QNN Backend. It appears the issue is due to parameters not being passed correctly to QNN.
However, I'm not sure why this change would cause the prepare step to fail. Do you have any thoughts?

@shewu-quic
Copy link
Collaborator Author

shewu-quic commented Nov 21, 2025

Hi @cccclai,

From my experiment, the issue is related to dynamic_cast, where p_tensor_param becomes nullptr even when param is a TensorParamWrapper*.
This appears to be due to differences between clang and the GNU C++ library, which affect RTTI matching.
When PyQnnXXX is built with clang, the cast results in nullptr regardless of RTLD_GLOBAL or RTLD_LIBRARY.
By default, PyQnnXXX is built with the GNU C++ library.
If you CDLL load the clang C++ library with GLOBAL, the cast fails and returns nullptr.
However, if you CDLL load the GNU C++ library first or load the clang C++ library with LOCAL, the cast works as expected.

I also replaced dynamic_cast with the code below, and confirmed that the typeid of param matches typeid(TensorParamWrapper).

if (typeid(*param.get()) ==typeid(TensorParamWrapper) ){
    p_tensor_param = static_cast<TensorParamWrapper*>(param.get());
}

Do you have any thoughts? Or do you have any concerns about loading the library with RTLD_LOCAL?”

@cccclai
Copy link
Contributor

cccclai commented Nov 21, 2025

Hmm I feel like we should find a way to build both libraries with the same compiler + same C++ standard library + same ABI settings, it's actually quite important for next release, maybe need to figure out if there is a way to do that

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants