libcu++: support subword extended floating-point atomic min and max. - #10828
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesThe small atomic dispatch supports Assessment against linked issues
Suggested reviewers: Merge Risk: 🟡 Moderate · up to The PR enables extended floating-point atomic min/max, but it is not merge-ready until the CAS-loop memory-order handling is corrected or explicitly accepted; supported operations may otherwise use invalid failure orders, and several tests may exercise the wrong atomic scope. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 0bee177c-bd68-4a92-a4ab-5a391c37bb1e
📒 Files selected for processing (2)
libcudacxx/include/cuda/std/__atomic/types/small.hlibcudacxx/test/libcudacxx/cuda/atomics/atomic.ext/atomic_fetch_extended_floating_point.pass.cpp
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
libcudacxx/test/libcudacxx/cuda/atomics/atomic.ext/atomic_fetch_extended_floating_point.pass.cpp (1)
82-112: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winimportant: Use
ThreadScopein all fourfetch_maxcases.cuda::atomic<T>defaults tocuda::thread_scope_system, while theseTestFninstantiations passcuda::thread_scope::thread_scope_thread. Change the aliases tocuda::atomic<T, ThreadScope>.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f5c551be-6e53-490d-80dd-ad498c610e5f
📒 Files selected for processing (2)
libcudacxx/include/cuda/std/__atomic/types/small.hlibcudacxx/test/libcudacxx/cuda/atomics/atomic.ext/atomic_fetch_extended_floating_point.pass.cpp
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.
⏱️ CCCL compile-time benchmark comparison: Public headers compile-time benchResult: 0 regression row(s), 3 improvement row(s) above threshold.
Artifacts: reports and traces Direct file processing
🟢 Direct file processing — Improvements
|
🥳 CI Workflow Results🟩 Finished in 2h 52m: Pass: 100%/117 | Total: 4d 07h | Max: 2h 52m | Hits: 60%/638898See results here. |
miscco
left a comment
There was a problem hiding this comment.
Looks "good" for extended floating point levels at least ^^
| template <class _Tp> | ||
| _CCCL_HOST_DEVICE_API bool __atomic_small_extended_floating_point_less(_Tp __lhs, _Tp __rhs) | ||
| { | ||
| #if _CCCL_HAS_CTK() && _CCCL_CTK_BELOW(12, 2) |
There was a problem hiding this comment.
There is _LIBCUDACXX_HAS_NVBF16() which does the additional CTK check
Description
Resolves #10810.
cuda::atomic<__half>andcuda::atomic<__nv_bfloat16>support basic atomic operations but currently rejectfetch_minandfetch_maxbecause the small-storage dispatch doesn't consider them to be floating point types. This PR changes the check to accept extended fp, and enables those operations using a widened CAS loop that decodes the stored value, performs a floating-point comparison, and writes the selected value back through the existing 32-bit representation.Checklist