KEMBAR78
Check F2C BLAS for OpenBLAS and other vendors by isuruf · Pull Request #143846 · pytorch/pytorch · GitHub
Skip to content

Conversation

@isuruf
Copy link
Collaborator

@isuruf isuruf commented Dec 26, 2024

Stack from ghstack (oldest at bottom):

This issue came from conda-forge/pytorch-cpu-feedstock#180. MKL follows the F2C convention for returning single precision floats as doubles and uses the G77 convention for returning complex valued scalars. OpenBLAS does the opposite. There is a check for this already, but it's done only when the Generic BLAS vendor code path is used and this PR moves that code to Dependencies.cmake to make it work when the BLAS vendor is OpenBLAS and others

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 26, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 172edad with merge base f79689b (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]
isuruf added a commit that referenced this pull request Dec 26, 2024
ghstack-source-id: 89d8a99
Pull Request resolved: #143846
Copy link
Collaborator

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

This LGTM, thanks @isuruf. Each of those BLAS libraries can be compiled with two ABIs indeed, and this check is needed (as the linked conda-forge issue shows). MKL, Accelerate and Eigen do not need to be checked. The one I wasn't familiar with was NVPL, and I can't find in its docs so quickly if it comes in two ABIs - I guess you know, and either way the check can't hurt.

@isuruf
Copy link
Collaborator Author

isuruf commented Jan 16, 2025

Yeah, I didn't know about NVPL so I kept the check there.

@isuruf
Copy link
Collaborator Author

isuruf commented Jan 16, 2025

@atalman can you review?

@isuruf
Copy link
Collaborator Author

isuruf commented Mar 13, 2025

ping on this

@atalman
Copy link
Contributor

atalman commented Mar 24, 2025

hi @isuruf could you please describe the issue you are trying to address ? Do you have a link ?

@isuruf
Copy link
Collaborator Author

isuruf commented Mar 24, 2025

@atalman, I updated the PR description.

@github-actions
Copy link
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label May 23, 2025
@isuruf isuruf added no-stale and removed Stale labels May 23, 2025
@isuruf
Copy link
Collaborator Author

isuruf commented May 23, 2025

can you review this @atalman ?

@isuruf
Copy link
Collaborator Author

isuruf commented Jun 22, 2025

Ping on this

@epiper-rv
Copy link

I am also running into problems that this change would fix. For example, torch.vdot do not work correctly with cpu tensors when compiling PyTorch with OpenBLAS. It instead returns 0 because it calls into cdotu_. See here for more details: OpenMathLib/OpenBLAS#5325 (comment)

Can we get this approved and merged?

Copy link
Contributor

@atalman atalman left a comment

Choose a reason for hiding this comment

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

lgtm

@isuruf
Copy link
Collaborator Author

isuruf commented Jun 30, 2025

@pytorchbot rebase -b viable/strict

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/isuruf/110/orig onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/143846)

@isuruf
Copy link
Collaborator Author

isuruf commented Jun 30, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jun 30, 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

[ghstack-poisoned]
[ghstack-poisoned]
isuruf added a commit that referenced this pull request Jul 1, 2025
ghstack-source-id: c7689c9
Pull Request resolved: #143846
@isuruf
Copy link
Collaborator Author

isuruf commented Jul 1, 2025

@pytorchbot merge

@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

@pytorchmergebot
Copy link
Collaborator

This PR (#143846) was merged in 8f0998a but it is still open, likely due to a Github bug, so mergebot is closing it manually. If you think this is a mistake, please feel free to reopen and contact Dev Infra.

pull bot pushed a commit to Superoldman96/pytorch that referenced this pull request Jul 1, 2025
This issue came from conda-forge/pytorch-cpu-feedstock#180. MKL follows the F2C convention for returning single precision floats as doubles and uses the G77 convention for returning complex valued scalars. OpenBLAS does the opposite. There is a check for this already, but it's done only when the Generic BLAS vendor code path is used and this PR moves that code to `Dependencies.cmake` to make it work when the BLAS vendor is OpenBLAS and others

Pull Request resolved: pytorch#143846
Approved by: https://github.com/rgommers, https://github.com/atalman
@github-actions github-actions bot deleted the gh/isuruf/110/head branch August 1, 2025 02:20
malfet added a commit that referenced this pull request Aug 2, 2025
Namely
```
CMake Warning (dev) in cmake/Dependencies.cmake:
  A logical block opening on the line

    /Users/nshulga/git/pytorch/pytorch/cmake/Dependencies.cmake:261 (if)

  closes on the line

    /Users/nshulga/git/pytorch/pytorch/cmake/Dependencies.cmake:263 (endif)

  with mis-matching arguments.
```

Introduced by #143846
pytorchmergebot pushed a commit that referenced this pull request Aug 3, 2025
Namely
```
CMake Warning (dev) in cmake/Dependencies.cmake:
  A logical block opening on the line

    /Users/nshulga/git/pytorch/pytorch/cmake/Dependencies.cmake:261 (if)

  closes on the line

    /Users/nshulga/git/pytorch/pytorch/cmake/Dependencies.cmake:263 (endif)

  with mis-matching arguments.
```

Introduced by #143846

Pull Request resolved: #159702
Approved by: https://github.com/cyyever, https://github.com/Skylion007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged no-stale open source release notes: build release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants