Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

drisspg
Copy link
Contributor

@drisspg drisspg commented May 1, 2025

Stack from ghstack (oldest at bottom):

Fixes: #147463

There is a mismatch between inductor's lowering for empty_like and it does not match the behavior of eager. The strides do not match preserve format

#144699

cc @msaroufim @jerryzh168 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @eellison

[ghstack-poisoned]
@drisspg drisspg requested a review from zou3519 as a code owner May 1, 2025 23:07
Copy link

pytorch-bot bot commented May 1, 2025

🔗 Helpful Links

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

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:

✅ No Failures

As of commit b87b57e with merge base 64957db (image):
💚 Looks good so far! There are no failures yet. 💚

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

[ghstack-poisoned]
@drisspg drisspg added module: performance Issues related to performance, either of kernel code or framework glue topic: not user facing topic category labels May 2, 2025
@drisspg drisspg added this to the 2.7.1 milestone May 2, 2025
@drisspg drisspg requested a review from xmfan May 2, 2025 00:03
[ghstack-poisoned]
drisspg added a commit that referenced this pull request May 2, 2025
ghstack-source-id: fbacaee
Pull Request resolved: #152641
Copy link
Member

@xmfan xmfan left a comment

Choose a reason for hiding this comment

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

we should probably still figure out why query got mutated, we're still using it for dtype and device

stride=[sympy.sympify(s) for s in grad_query_strides],
dtype=query.get_dtype(),
device=query.get_device(),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

in your test, what different strides do you get for grad_query before/after your change?

I could believe this is right. But one thing I'm surprised by is that it looks like empty_like() effectively calls these same two functions under the hood when you run it with the default MemoryFormat::Preserve (infer_dense_strides+empty_strided`). See here:

infer_dense_strides(self.sizes(), self.strides());

@drisspg
Copy link
Contributor Author

drisspg commented May 2, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 2, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@drisspg
Copy link
Contributor Author

drisspg commented May 2, 2025

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@drisspg
Copy link
Contributor Author

drisspg commented May 2, 2025

@pytorchbot merge -i "the command is hanging / not making progress"

Copy link

pytorch-bot bot commented May 2, 2025

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: unrecognized arguments: the command is hanging / not making progress

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci,cherry-pick,close} ...

Try @pytorchbot --help for more info.

@drisspg
Copy link
Contributor Author

drisspg commented May 2, 2025

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 0 checks:

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@drisspg
Copy link
Contributor Author

drisspg commented May 2, 2025

@pytorchbot merge -f "This seems to be in a weird state"

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@drisspg
Copy link
Contributor Author

drisspg commented May 2, 2025

@pytorchbot merge -f "This seems to be in a weird state"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@drisspg
Copy link
Contributor Author

drisspg commented May 15, 2025

@pytorchbot cherry-pick --onto release/2.7 -c critical

pytorchbot pushed a commit that referenced this pull request May 15, 2025
Fixes: #147463

There is a mismatch between inductor's lowering for empty_like and it does not match the behavior of eager. The strides do not match preserve format

#144699

Pull Request resolved: #152641
Approved by: https://github.com/xmfan

(cherry picked from commit a6ea63a)
@pytorchbot
Copy link
Collaborator

Cherry picking #152641

The cherry pick PR is at #153641 and it is recommended to link a critical cherry pick PR with an issue. The following tracker issues are updated:

Details for Dev Infra team Raised by workflow job

atalman pushed a commit that referenced this pull request May 21, 2025
[FlexAttention] explicilty create grad_q w/ strides (#152641)

Fixes: #147463

There is a mismatch between inductor's lowering for empty_like and it does not match the behavior of eager. The strides do not match preserve format

#144699

Pull Request resolved: #152641
Approved by: https://github.com/xmfan

(cherry picked from commit a6ea63a)

Co-authored-by: drisspg <[email protected]>
@github-actions github-actions bot deleted the gh/drisspg/146/head branch June 15, 2025 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor module: performance Issues related to performance, either of kernel code or framework glue topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants