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

[Compilation] Allow ThinLTO and Fix CI flakiness #1460

Merged
merged 7 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ jobs:
--cmake-args='-DCMAKE_CXX_FLAGS="--coverage"'

while [ ! -f ~/miniconda/pytorch_installed ]; do sleep 2; done # wait for Pytorch
pytest -n auto --durations=10 --cov-report=xml --cov=./
pytest -n 8 --durations=10 --cov-report=xml --cov=./

#run the marked pytest-benchmark tests and print the results
pytest -m sim_benchmarks
Expand Down
9 changes: 8 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
# Policy that enables INTERPROCEDURAL_OPTIMIZATION
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
cmake_policy(SET CMP0069 NEW)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")

if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"
OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION
VERSION_LESS 13.0)
)
message(
"-- Forcing full LTO for compatibility: ThinLTO requires LLVM Clang>=13.0"
)
# Clang has some issues with thinLTO (segfaults on final linking)
# This enables full LTO through CMake
# FullLTO is slow, but may yield performance improvements.
Expand Down