Repository navigation
Give the A40 device GEMM a named functor (#815) - #841
Merged
Merged
Conversation
nvcc keeps an extended host-device lambda's copy, call and delete functions in per-file statics set where the lambda is constructed, while Kokkos's dispatch that copies it is an inline template shared between files. device_dense_gemm's views are the same in three files, so a Release link kept one file's dispatch, and a radial run that had built the lambda only in another file called a null copy function in advance. A named functor's copy is its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPwwkUUG9KSAwneHjgH
A static check over the extension's object files, run in the CUDA device-compile lane: it fails when an extended lambda's helper statics appear in more than one file, the condition behind #815, with Kokkos-FFT's never-constructed normalisation lambda allowed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPwwkUUG9KSAwneHjgH
codespell reads "statics" as a misspelling of "statistics"; the comments now say static members or variables. The check sees only the kernels its build's device target instantiates: the CUDA device-compile lane builds for compute capability 9.0, which compiles no device_dense_gemm, so the lambda behind #815 shows only in a build for 8.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPwwkUUG9KSAwneHjgH
On a Release CUDA build for compute capability 8.6 every radial run crashed in its first step, envelope or field, with or without a collar or statistics, with every stepper; other device targets compile no such GEMM. The changelog entry says so, and the design page states the rule that a shared header's kernel instantiated alike in several files is a named functor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGENPwwkUUG9KSAwneHjgH
jtravs
marked this pull request as ready for review
November 15, 2026 18:32
Codex Review Summary: ✅ CompletedThis 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
On a Release CUDA build for compute capability 8.6 (
AMPERE86, such as the NVIDIA A40), every radial native run segfaulted in the session's firstadvance. That held for every stepper, envelope or field grid, linear or Kerr, and with or without a collar or statistics.Cause.
device_dense_gemm's kernel was an extended__host__ __device__lambda.dispersive.cpp,statistics.cpp,trial.cpp), and the link keptdispersive.cpp's dispatch.trial.cpporstatistics.cpp, so its first step calleddispersive.cpp's copy slot, which was still null. A SIGSEGV handler reportedrip=0just after the call through that slot.Other device targets are unaffected: a
HOPPER90build compiles nodevice_dense_gemm.Fix. The kernel is now a named functor (
DeviceDenseGemm), whose copy is its own. The arithmetic is unchanged.Guard.
native/ci/check_lambda_tags.pyfails a CUDA build's object files when more than one of them holds the same extended lambda. Kokkos-FFT's never-constructednormalize_impllambdas are allowed.HOPPER90, so it cannot see this particular lambda; againstAMPERE86objects it flags main and passes this branch.docs/dev/backends.mdstates the named-functor rule.GPU lane, NVIDIA A40, CUDA 12.8.1, Release
AMPERE86, cuBLAS on:poe test-gpupytest -m gpu -p no:randomly testsCloses #815
🤖 Generated with Claude Code
https://claude.ai/code/session_01XGENPwwkUUG9KSAwneHjgH