Skip to content
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

AppleClang15 patch #116

Conversation

raneamri
Copy link
Contributor

@raneamri raneamri commented May 22, 2024

Description

Mac Silicon compatibility fix. Aims to resolve Apple Silicon Support #99. Includes:

  • Repairing overloads that cause issues on M1
  • Adding NATIVE and APPLE_M1 SIMD options
  • An expanded Mac workflow which includes macos-13 & macos-latest, Debug and Release
  • Patching a test which warranted a degree of error

Additional non-issue related changes:

  • Addition of formatting rule to include newlines at EOF
  • Repair of Windows 14.1 build
  • Changed Mac (Debug) lcov version 2.1 -> 1.14 to repair coverage baseline issuses

Type of change

  • Bug fix (non-breaking change which adds support for a platform)

Copy link

github-actions bot commented May 22, 2024

Test Results

    29 files  ±0      29 suites  ±0   10m 52s ⏱️ +2s
 1 275 tests ±0   1 275 ✅ ±0  0 💤 ±0  0 ❌ ±0 
36 937 runs  ±0  36 937 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f1f86f4. ± Comparison against base commit c17c084.

♻️ This comment has been updated with latest results.

… longer used on arm architectures\n- NEON SIMD option only auto selected on arm architectures, defaults to AVX otherwise\n- polar() function now defaults arg2 to 0.0 rather than throwing an error/ignoring overload\n- <StdCompatibility.cpp> auto included for arm & appleclang15\n - One test changed in Complex_test.cpp to prevent overload error. This is a temporary change and the test will be restored once the error related to std::norm is fixed\n - Added Mac Clang15 workflow (debug & release) to ci.yml (yet to test)
- Proper overload for std::norm now selected when norm is called with type param.
- Added NEON SIMD option to drop down menu for CMake GUI
- Restored test I previously changed
Copy link
Collaborator

@auto-differentiation-dev auto-differentiation-dev left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. Please address the review comments before we can merge this.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
cmake/SetupCompiler.cmake Outdated Show resolved Hide resolved
cmake/SetupCompiler.cmake Show resolved Hide resolved
cmake/SetupOptions.cmake Outdated Show resolved Hide resolved
cmake/SetupOptions.cmake Outdated Show resolved Hide resolved
src/XAD/Complex.hpp Outdated Show resolved Hide resolved
src/XAD/Complex.hpp Outdated Show resolved Hide resolved
src/XAD/Complex.hpp Outdated Show resolved Hide resolved
src/XAD/UnaryOperators.hpp Outdated Show resolved Hide resolved
src/XAD/XAD.hpp Outdated Show resolved Hide resolved
@auto-differentiation-dev
Copy link
Collaborator

Regarding the failing Windows toolset 14.1 build, could you change the CI/CD so that MSVC 14.0 and 14.1 are using the runner image windows-2019 instead? This image seems to have both toolsets installed. You can see here that this already done for 14.0.

- M1 workflow no longer needlessly installs llvm15
- Fixed erroneous formatting error & redundant flag addition
- SIMD: NEON -> APPLE_M1, & added NATIVE
- norm overloads now use = Constructor() rather than = 0 where relevant
- Removed redundant include of <StdCompatibility.hpp> in XAD.hpp
- Windows 14.1 build now uses 2019 runner
cmake/SetupCompiler.cmake Show resolved Hide resolved
cmake/SetupCompiler.cmake Outdated Show resolved Hide resolved
cmake/SetupCompiler.cmake Outdated Show resolved Hide resolved
cmake/SetupCompiler.cmake Outdated Show resolved Hide resolved
cmake/SetupOptions.cmake Show resolved Hide resolved
src/XAD/Complex.hpp Outdated Show resolved Hide resolved
src/XAD/Complex.hpp Outdated Show resolved Hide resolved
src/XAD/UnaryOperators.hpp Outdated Show resolved Hide resolved
@auto-differentiation-dev
Copy link
Collaborator

Given the differences between the different compiler versions and Mac architectures, I believe we should extend the CI/CD build into a wider matrix build (similar to Linux/Windows). You can see here that both Arm and Intel based runners are available, and we have Clang 14/15 to test with on each. Plus Debug/Release and coverage.

If you want to do that as part of this PR, that would be great. Otherwise it could also be done in a separate one.

- Changed APPLE_M1 flag -march=apple-m1 -> -march=armv8.5-a
- Removed redundant GNU branch in SetupCompiler.cmake
- Added better system resolve (Darwin/Linux) in SetupOptions.cmake
- Changed overload for norm as to enable if type is XAD rather than disable if type is a c++ native type

This fix intends to fix the flag issue for the macoslatest workflow. It may not; in which case this task is relayed it to the next commit.
Next fix will fix baseline coverage issues for Mac (Debug)
- Merged macos-13 & macos-latest into wider matrix build.
- Changed Mac (Debug) to use [email protected] rather than [email protected] to try fix coverage baseline issue.
- Changed Expressions_test 1686 to use tolerance value rather than DOUBLE_EQ.

The lcov version downgrade may not fix coverage baseline, in which case that change will be reverted
@coveralls
Copy link
Collaborator

coveralls commented Jun 3, 2024

Pull Request Test Coverage Report for Build 9364361988

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on feature/appleclang15-fix at 98.793%

Totals Coverage Status
Change from base Build 8921008543: 98.8%
Covered Lines: 2291
Relevant Lines: 2319

💛 - Coveralls

Copy link
Collaborator

@auto-differentiation-dev auto-differentiation-dev left a comment

Choose a reason for hiding this comment

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

It is nearly ready now - if you could only look after the two small comments that are left, we'll get this merged into the main branch.

.github/workflows/ci.yml Show resolved Hide resolved
cmake/SetupOptions.cmake Outdated Show resolved Hide resolved
@auto-differentiation-dev auto-differentiation-dev merged commit 1b8be41 into auto-differentiation:main Jun 4, 2024
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apple Silicon Support
4 participants