Skip to content

Fix false positive AVX, AVX2 and AVX512 detection with MSVC#82554

Closed
JohT wants to merge 1 commit intopytorch:masterfrom
JohT:fix/avx-detection
Closed

Fix false positive AVX, AVX2 and AVX512 detection with MSVC#82554
JohT wants to merge 1 commit intopytorch:masterfrom
JohT:fix/avx-detection

Conversation

@JohT
Copy link
Contributor

@JohT JohT commented Jul 31, 2022

Description

These changes were made to assure, that the code that tests the vector instruction set extensions not only compiles but also runs to detect it properly for MSVC:

  • INCLUDE(CheckCSourceRuns) instead of INCLUDE(CheckCSourceCompiles)
  • INCLUDE(CheckCXXSourceRuns) instead of INCLUDE(CheckCXXSourceCompiles)
  • CHECK_C_SOURCE_RUNS instead of CHECK_C_SOURCE_COMPILES
  • CHECK_CXX_SOURCE_RUNS instead of CHECK_CXX_SOURCE_COMPILES

Issue

#82553

Testing

I tried the code changes on a copy of FindAVX.cmake in my repository convolution-benchmarks and could verify that the detection works properly now.

@facebook-github-bot
Copy link
Contributor

Hi @JohT!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 31, 2022

🔗 Helpful links

✅ No Failures (0 Pending)

As of commit 697afd5 (more details on the Dr. CI page):

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@kit1980 kit1980 self-requested a review August 1, 2022 16:46
Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

LGTM, provided it passes M1 cross-compilation (I remember had to revert several runs back to compiles)

@malfet malfet added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 1, 2022
@malfet
Copy link
Contributor

malfet commented Aug 1, 2022

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2022

Hey @JohT.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@JohT
Copy link
Contributor Author

JohT commented Aug 2, 2022

@pytorchbot label release notes: cpp

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 2, 2022

Didn't find following labels among repository labels: release,notes:,cpp

@JohT
Copy link
Contributor Author

JohT commented Aug 2, 2022

@pytorchbot label "release notes: cpp"

@pytorch-bot pytorch-bot bot added the release notes: cpp release notes category label Aug 2, 2022
@JohT
Copy link
Contributor Author

JohT commented Aug 2, 2022

@pytorchbot label "topic: bug fixes"

@pytorch-bot pytorch-bot bot added the topic: bug fixes topic category label Aug 2, 2022
@malfet malfet added release notes: build release notes category and removed release notes: cpp release notes category labels Aug 2, 2022
facebook-github-bot pushed a commit that referenced this pull request Aug 3, 2022
…82554)

Summary:
### Description

These changes were made to assure, that the code that tests the vector instruction set extensions not only compiles but also runs to detect it properly for MSVC:
- INCLUDE(CheckCSourceRuns) instead of INCLUDE(CheckCSourceCompiles)
- INCLUDE(CheckCXXSourceRuns) instead of INCLUDE(CheckCXXSourceCompiles)
- CHECK_C_SOURCE_RUNS instead of CHECK_C_SOURCE_COMPILES
- CHECK_CXX_SOURCE_RUNS instead of CHECK_CXX_SOURCE_COMPILES

### Issue
#82553

### Testing
I tried the [code changes](JohT/convolution-benchmarks@86246b3) on a copy of [FindAVX.cmake](https://github.com/pytorch/pytorch/blob/master/cmake/Modules/FindAVX.cmake) in my repository [convolution-benchmarks](https://github.com/JohT/convolution-benchmarks) and could verify that the detection works properly now.

Pull Request resolved: #82554
Approved by: https://github.com/malfet

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/2ffb23616d5b24903558784678a3cdfd263ba155

Reviewed By: kit1980

Differential Revision: D38359391

fbshipit-source-id: 826c1bb30d640f36526af464746eaa6b573ccd95
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 cla signed Merged open source release notes: build release notes category topic: bug fixes topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants