Repository navigation
perf(build): compile the release for x86-64-v3 (AVX2) - #43
Merged
Merged
Conversation
The wave kinematics and the element kernels spend most of their time in vectorised cos/sin/exp, which the release build ran two doubles wide (SSE2). CABLEDYN_TARGET_AVX2 compiles the Fortran core for x86-64-v3 (/arch:CORE-AVX2 with IFX, -march=x86-64-v3 with gfortran 11+), and the static Windows release sets it: the IFX driver runs the benchmark decks 13-33% faster (lazy_wave_vessel_rao 11.9 s to 8.8 s, als_volturnus_line_break_time 35.5 s to 23.9 s). Contraction into fused multiply-adds stays off (/Qfma-, -ffp-contract=off): with it the compiler fuses the same expression differently where it is inlined, and a restored instance no longer continued a run bit for bit (test_line_attachments). src/cabledyn_cpu_guard.c, compiled for baseline x86-64, checks the processor before any Fortran code runs and stops a program on an older one with a message naming the missing instructions (exit 3). It writes with the operating system's calls only: in the Windows GNU build the C library names can resolve to openblas.dll's exports and import it at load time. CABLEDYN_CPU_GUARD_SIMULATE exercises the stop on any processor; the release script checks it for both executables, and the driver's --version and the OpenFAST module's start-up lines report the x86-64-v3 build. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
Owner
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
6 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First item of the speed programme before 0.3.0.
The problem. Profiling the release driver (IFX, static) on the benchmark decks put the largest share in the vectorised
cos/sin/expof the wave kinematics: 24 % oflazy_wave_vessel_raoand 37 % ofals_volturnus_line_break_time. The element kernels came next. The release build targets baseline x86-64, so this vector maths ran only two doubles wide (SSE2).What changes:
CABLEDYN_TARGET_AVX2(CMake option, defaultOFF) compiles the Fortran core for x86-64-v3 (Intel Haswell and AMD Excavator or newer):/arch:CORE-AVX2 /Qfma-. The/archform is the vendor-neutral one;/Qxgave the same code and speed here.-march=x86-64-v3 -ffp-contract=off.test_line_attachmentsfailed with gfortran x86-64-v3). Contraction was worth only 2–5 % more speed.src/cabledyn_cpu_guard.c):fprintfresolved toopenblas.dll's exports and imported it at load time, which defeated the run-time BLAS loading.CABLEDYN_CPU_GUARD_SIMULATEexercises the stop on any processor.CableDyn_driver --versionprints the build line (x86-64-v3 (AVX2)orbaseline). The OpenFAST module printsCableDyn build: x86-64-v3 (AVX2).at initialisation. These references also keep the check in the static links./arch:CORE-AVX2. It requires both executables to report the x86-64-v3 build, and to stop with exit 3 and the message under the simulated missing feature.doc/installation.rstand the README asset table; the option inDEVELOPMENT.md; CHANGELOG entry.Speed (IFX static release configuration, this workstation, mean of two runs)
lazy_wave_vessel_raobuoy_clamped_cableals_volturnus_line_break_timeResult changes (round-off)
lazy_wave_vessel_raobuoy_clamped_cableals_volturnus_line_break_timeOn the line-break deck, statistics over the whole run match dev:
AnchTen2FairTen3Body1RzVerification
pre-commit run --all-filesand the Sphinx-Wbuild pass.-DCABLEDYN_TARGET_AVX2=ONbuild (gfortran, x86-64-v3): ctest 298/298, includingcpu_guardand the end-to-endcpu_guard_stop.libcabledyn.dllimports noopenblas.dll.--versionreportsx86-64-v3 (AVX2);CABLEDYN_CPU_GUARD_SIMULATEthe driver prints the message and exits 3 before the banner.CompMooring = 5run terminates normally.Checklist
pre-commit run --all-filespassesctest --test-dir build --output-on-failurepassespython -m pytest tests python/testspasses (if Python or validation records changed)[Unreleased](heading added if missing) for user-visible changesdoc/updated for changed inputs, options, or outputsfeat:,fix:,docs:, ...)git commit -s) under theDeveloper Certificate of Origin