Skip to content

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

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

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 Cancelled Job

As of commit 9def8ff with merge base 7a2dc47 (image):

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 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
@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.

@cccclai cccclai added partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm topic: not user facing labels Jan 8, 2025
@facebook-github-bot facebook-github-bot merged commit 2e24b4e into pytorch:main Jan 8, 2025
45 of 46 checks passed
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. partner: qualcomm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants