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

Qualcomm AI Engine Direct - Optimize static llama phase 2 #7466

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shewu-quic
Copy link
Collaborator

@shewu-quic shewu-quic commented Jan 2, 2025

  • Modify custom annotation for kv in llama
  • Remove unneccesary reshape op
  • Refactor requantize mechanism
    • Support partial of ops to insert to_copy
    • For the same quant_attr share the same to_copy op
  • Remove qdq for I/O
  • Refine calibration and runner in prefill mode
  • (new) Support graph sharding in hybrid mode

Copy link

pytorch-bot bot commented Jan 2, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 9def8ff with merge base 7a2dc47 (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 Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

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

@facebook-github-bot
Copy link
Contributor

@cccclai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@cccclai
Copy link
Contributor

cccclai commented Jan 7, 2025

Hey can you help rebase?

Copy link
Contributor

@cccclai cccclai left a comment

Choose a reason for hiding this comment

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

LGTM and thank you for the refactor!

- Modify custom annotation for kv in llama
- Remove unneccesary reshape op
- Refactor requantize mechanism
 - Support partial of ops to insert to_copy
 - For the same quant_attr share the same to_copy op
- Remove qdq for I/O
- Refine calibration and runner in prefill mode
- Support graph sharding in hybrid mode
@shewu-quic shewu-quic force-pushed the dev1/hutton/optimize_static_llama_phase2 branch from b914a15 to 9def8ff Compare January 8, 2025 00:57
@shewu-quic
Copy link
Collaborator Author

Hey can you help rebase?

I have rebased.

I add graph sharding support in hybrid mode. This has the most significant impact on performance. When HTP execution time exceeds RPC polling time (10 ms in burst mode), CPU frequency may drop to its minimum. Our experiments indicate that setting num_sharding to 4 yields the best results. However, this depends on the device. Aim to keep the execution time for each partition under 10ms ( RPC polling time).

rpc_polling_time.rpcPollingTimeConfig = kRpcPollingTimeHighPower;

@facebook-github-bot
Copy link
Contributor

@cccclai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

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