Skip to content

Metal backend: fix bugs in qmv_impl#17188

Open
manuelcandales wants to merge 3 commits intogh/manuelcandales/158/headfrom
gh/manuelcandales/159/head
Open

Metal backend: fix bugs in qmv_impl#17188
manuelcandales wants to merge 3 commits intogh/manuelcandales/158/headfrom
gh/manuelcandales/159/head

Conversation

@manuelcandales
Copy link
Contributor

@manuelcandales manuelcandales commented Feb 4, 2026

Fixes two bugs in qmv_impl (also submitted PR 3096 to MLX)

  • Fix 1: Changed qdot to qdot_safe when handling remaining elements in the N < 8 case
    Notice that in qmv_impl, there are two code paths based on whether N < 8:

    • When N >= 8: Correctly uses qdot_safe for remaining elements
    • When N < 8: Incorrectly used qdot instead of qdot_safe for remaining elements (fixed in this PR)
  • Fix 2: Changed in_vec_size_g from floor division to ceiling division to correctly handle cases where K is not a multiple of group size

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 4, 2026

🔗 Helpful Links

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

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

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

[ghstack-poisoned]
[ghstack-poisoned]
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