Skip to content

Qualcomm AI Engine Direct - DRAFT for GA QWEN2.5 0.5B #12054

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

winskuo-quic
Copy link
Collaborator

@winskuo-quic winskuo-quic commented Jun 27, 2025

Summary

Static Qwen2.5 0.5b enablement.

Script
python examples/qualcomm/oss_scripts/qwen/qwen.py -b build-android -s $DEVICE -m SM8750 --decoder_model qwen2_5 --prompt "Hello, how are you?" --max_seq_len 128

Stats

Speed: 128tok/sec on SM8750, seq_len = 128
Accuracy: Bad (QDQ already bad but not as bad)

Test plan

[PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.

Author: @haowhsu-quic, @winskuo-quic

Copy link

pytorch-bot bot commented Jun 27, 2025

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure

As of commit 0c4785b with merge base 695c7d5 (image):

NEW FAILURE - The following job has failed:

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

@facebook-github-bot facebook-github-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 Jun 27, 2025
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@winskuo-quic
Copy link
Collaborator Author

Hi @billmguo, @cccclai,

This is a draft for qwen2.5 0.5 using static nn.Module structure.
Please notice this is just a draft as the accuracy for the model is still bad.

Thanks

@cccclai
Copy link
Contributor

cccclai commented Jun 27, 2025

Thanks! If it's just the accuracy is bad, @rohansjoshi has been making progress on this. Can qwen model run with this PR (don't need to be accurate)?

from transformers.configuration_utils import PretrainedConfig


class RMSNorm(nn.Module):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to have the same static llama file (maybe with some branches) instead of starting a new static qwen model

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for reviewing the PR. We are trying to have a static decoder file that can be shared across all GA decoder models + LLama.
For this draft, we are just making sure e2e flow is working, and we will work on merging all static decoder files to 1.

@winskuo-quic
Copy link
Collaborator Author

Thanks! If it's just the accuracy is bad, @rohansjoshi has been making progress on this. Can qwen model run with this PR (don't need to be accurate)?

Yes. The can model can run with this PR.
I have an example script and stats shared in the summary section.

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.

3 participants