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 - Mimi Enablement Stage 2 #10098

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

Conversation

winskuo-quic
Copy link
Collaborator

@winskuo-quic winskuo-quic commented Apr 11, 2025

Summary

  • Support Mimi Encoder
  • Support Mimi Decoder
  • Support OP: CDist
  • Workaround for 0D tensor scenario since QNN does not support 0D tensor

Commands to Execute the model
10 sec as a batch (1 inference for 10 sec audio):
python examples/qualcomm/oss_scripts/moshi/mimi.py -b build-android -s $DEVICE -m SM8650 --chunks_per_batch 125

80s as a batch (125 inferences for 10 sec audio)
python examples/qualcomm/oss_scripts/moshi/mimi.py -b build-android -s $DEVICE -m SM8650

Test plan

  • UT for CDist
  • UT for 0D tensor

@winskuo-quic winskuo-quic requested a review from cccclai as a code owner April 11, 2025 03:28
Copy link

pytorch-bot bot commented Apr 11, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 08759d6 with merge base e29a4b5 (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 Apr 11, 2025
Copy link

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.

@winskuo-quic winskuo-quic force-pushed the dev1/winskuo/mimi_stage2 branch from 3377f9d to a7cd07a Compare April 11, 2025 05:45
@winskuo-quic winskuo-quic force-pushed the dev1/winskuo/mimi_stage2 branch from a7cd07a to 4501ff2 Compare April 11, 2025 08:41
@winskuo-quic
Copy link
Collaborator Author

Hi @cccclai, @iseeyuan, @billmguo,
This PR is to enable mimi without streaming mode.
I have listed to execution commands in the summary section.
Please have a look.
Thanks

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

from executorch.exir.pass_base import ExportPass, PassResult


class Remove0DTensor(ExportPass):
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @cccclai,
Thanks for reviewing the PR.
I believe the pass you are suggesting is to change input from 0d to 1d tensor.
However, for our case, this 0D tensor happened during select op in the middle of graph. We just removed this select op since it does not affect the logic of the graph.
The exact point where 0D tensor occurs in mimi is under moshi/quantization/core_vq.py, where is tries to create a 1D tensor and retrieve index 0.
image

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