Skip to content

Fix pid_m calculation #4539

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RandySheriff
Copy link

Summary:
When calculating current pid_m, pid should be first mode by width, then by group_size, not directly by group_size.
Assume we have:

  • grid_m = 5
  • grid_n = 5
  • group_m = 3

Then for pid 15, the corresponding pid_m should be 4.
However, following the current logic that

id_m = group_id * GROUP_M + (pid % group_size)

pid_m = 1 * 3 + (15%2) = 3+1 = 4 !?

Differential Revision: D78712591

Summary:
When calculating current pid_m, pid should be first mode by width, then by group_size, not directly by group_size.
Assume we have:
- grid_m = 5
- grid_n = 5
- group_m = 3

Then for pid 15, the corresponding pid_m should be 4.
However, following the current logic that

``` 
id_m = group_id * GROUP_M + (pid % group_size)
```

pid_m = 1 * 3 + (15%2) = 3+1 = 4 !?

Differential Revision: D78712591
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78712591

Copy link

netlify bot commented Jul 22, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 45e6aa0
🔍 Latest deploy log https://app.netlify.com/projects/pytorch-fbgemm-docs/deploys/687f14b5935f310008566aa7
😎 Deploy Preview https://deploy-preview-4539--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants