Skip to content

Conversation

@chenweng-quic
Copy link
Collaborator

@chenweng-quic chenweng-quic commented Jan 2, 2026

Summary

  • Fix static cache used by t5 and whisper
  • Fix online prepare on Mutable buffer
  • Fix minor issues

Test plan

python ${EXECUTORCH_ROOT}/backends/qualcomm/tests/test_qnn_delegate.py -k test_t5 --model SM8650 --build_folder build-android --host <host> --device <device_id>--executorch_root ${EXECUTORCH_ROOT} --artifact_dir ./t5_artifact --qa_dataset SQuAD-v1.1.csv
python ${EXECUTORCH_ROOT}/backends/qualcomm/tests/test_qnn_delegate.py -k test_whisper --model SM8650 --build_folder build-android --host <host> --device <device_id>--executorch_root ${EXECUTORCH_ROOT} --artifact_dir ./whisper_artifact_dir

cc @cccclai @cbilgin

- Fix t5 and whisper
- Fix online prepare for mutable buffer
- Fix minor issues
@chenweng-quic chenweng-quic requested a review from cccclai as a code owner January 2, 2026 03:59
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 2, 2026

🔗 Helpful Links

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

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:

✅ You can merge normally! (1 Unrelated Failure)

As of commit ba138a5 with merge base c730feb (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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 Jan 2, 2026
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

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.

@chenweng-quic chenweng-quic added the module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ label Jan 2, 2026
Copy link
Contributor

@mergennachin mergennachin left a comment

Choose a reason for hiding this comment

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

See inline comments

)
multiples = []
for i in range(len(reshape_tensor.shape)):
multiples.append(output_tensor.shape[i] // reshape_tensor.shape[i])
Copy link
Contributor

Choose a reason for hiding this comment

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

assert output_tensor.shape[i] % reshape_tensor.shape[i] == 0, f"Shape mismatch at dim {i}: {output_tensor.shape[i]} not divisible by {reshape_tensor.shape[i]}"

Comment on lines +72 to +77
for idx in range(len(self.static_cache.layers)):
self.register_buffer(f"key_cache_{idx}", self.static_cache.layers[idx].keys)
for idx in range(len(self.static_cache.layers)):
self.register_buffer(
f"value_cache_{idx}", self.static_cache.layers[idx].values
)
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: can do in one loop

) -> QuantizationConfig:
# the smallest scale: 0.0001 / 255
extra_args: Dict[str, Any] = {"eps": 2**-21}
# the smallest scale defaults to 0.0001 / 255
Copy link
Contributor

Choose a reason for hiding this comment

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

# At top of file

  DEFAULT_EPS_8BIT = 0.0001 / 255 
  DEFAULT_EPS_16BIT = 0.0001 / 65535

  # In functions
  extra_args: Dict[str, Any] = {"eps": eps if eps else DEFAULT_EPS_8BIT}

You are repeating this pattern over and over again. 2 times for 8it and 6 times for 16bit

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. module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants