Skip to content

Use two-pass IPO for OpenMP offload as well - #1880

Open
sbryngelson wants to merge 1 commit into
masterfrom
ci/enable-ipo-for-openmp-offload
Open

Use two-pass IPO for OpenMP offload as well#1880
sbryngelson wants to merge 1 commit into
masterfrom
ci/enable-ipo-for-openmp-offload

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

The NVHPC two-pass IPO (-Mextract/-Minline) was applied to OpenACC and skipped wholesale for OpenMP offload, so that lane gave up cross-file inlining entirely. The reason turns out to be a single compiler bug rather than anything structural:

nvfortran-Fatal-.../tools/fort2 TERMINATED by signal 11
gmake[3]: *** [.../m_data_output.fpp.f90.o] Error 2

fort2 segfaults inlining into m_data_output under OpenMP offload. OpenACC compiles the same file cleanly.

This is the same failure class as the existing m_start_up/m_cbc exclusions — OpenMP offload just reaches it in one more place — so it gets the same treatment, scoped with MFC_OpenMP so the OpenACC build keeps full inlining there and loses nothing.

Verification

On A100 / NVHPC 25.11:

(The 10 execution failed entries in my local sweep are a pre-existing Chemistry environment issue on this box — identical UUIDs in every configuration, including unmodified builds.)

Only one extra exclusion was needed, not a cascade.

Worth weighing before merging

OpenMP offload has been the one NVHPC GPU path not subject to this pass, and that independence is exactly what identified the OpenACC miscompile in #1878 — omp passing 713/713 where acc failed 23 is what ruled out the physics and pointed at IPO.

Enabling IPO here buys inlining on that lane at the cost of that cross-check, on a pass with a track record of three separate defects, one of them silent. Reasonable either way, but it should be a deliberate call rather than a side effect of the fix — which is why it's split out.

If you'd rather keep the independent lane, closing this is a perfectly good outcome; the fort2 segfault documented above is worth keeping on record regardless, since it's the actual reason the exclusion existed.

Merge note

Touches the same block as #1878's m_pressure_relaxation exclusion. Whichever lands second needs a one-line rebase.

https://claude.ai/code/session_017zrZooJPhZtZYgg9fJiYhg

The NVHPC two-pass IPO (-Mextract/-Minline) was applied to OpenACC and
skipped wholesale for OpenMP offload, so the OpenMP lane gave up
cross-file inlining entirely. The reason turns out to be a single
compiler bug rather than anything structural:

    nvfortran-Fatal-.../tools/fort2 TERMINATED by signal 11
    gmake[3]: *** [.../m_data_output.fpp.f90.o] Error 2

fort2 segfaults inlining into m_data_output under OpenMP offload;
OpenACC compiles the same file cleanly. This is the same failure class
as the existing m_start_up/m_cbc exclusions -- OpenMP offload just
reaches it in one more place -- so it gets the same treatment, scoped
with MFC_OpenMP so the OpenACC build is unaffected.

With that one exclusion the OpenMP build completes with no crashes
(all four targets), and on A100 / NVHPC 25.11 a 1D sweep gives 175
passed and zero tolerance mismatches. The six cases that the OpenACC
IPO bug corrupted all pass here.

Worth weighing before merging: OpenMP offload has been the one NVHPC
GPU path not subject to this pass, and that independence is exactly
what identified the OpenACC miscompile -- omp passing 713/713 where acc
failed 23 is what ruled out the physics. Enabling IPO here buys
inlining on that lane at the cost of that cross-check, on a pass with a
track record of three separate defects, one of them silent. Reasonable
either way, but it should be a deliberate call and not a side effect.

Depends on nothing, but touches the same block as the
m_pressure_relaxation exclusion; whichever lands second needs a
one-line rebase.

Claude-Session: https://claude.ai/code/session_017zrZooJPhZtZYgg9fJiYhg
Copilot AI lite review requested due to automatic review settings September 13, 2026 14:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Enables NVHPC two-pass IPO (-Mextract/-Minline) for OpenMP offload builds while adding a targeted per-source exclusion to avoid a known fort2 crash during inlining.

Changes:

  • Apply NVHPC two-pass IPO to OpenMP offload targets (previously skipped).
  • Add conditional no-inline exclusion for m_data_output only under the OpenMP offload configuration.
  • Refactor the no-inline list to allow conditional extensions cleanly.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants