Use cuda::std::numeric_limits in LAP kernels instead of passing infinity - #3094
Merged
rapids-bot[bot] merged 2 commits intoJul 29, 2026
Merged
Conversation
The LAP Hungarian-algorithm kernels took the sentinel infinity (std::numeric_limits<weight_t>::max()) as a host-computed kernel argument, guarded by FIXMEs to switch to cuda::std::numeric_limits once CUDA 10.2 was the baseline. That baseline is long met, so this computes the limit on-device instead. Drops the infinity parameter from kernel_rowReduction, kernel_columnReduction, kernel_dualUpdate_1 and kernel_dualUpdate_2 and their call sites in lap_functions.cuh, and includes cuda/std/limits. Verified: SOLVERS_TEST builds clean; all 6 Hungarian LAP tests pass.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesLAP sentinel cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Contributor
Author
|
Could a maintainer please add the required labels when you get a chance? This is a non-functional refactor (identical sentinel value, just computed on-device), so |
divyegala
approved these changes
Jul 29, 2026
Contributor
|
/ok to test 22ac277 |
Contributor
|
/merge |
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.
Description
The LAP (Linear Assignment Problem) Hungarian-algorithm kernels took the sentinel
"infinity" value —
std::numeric_limits<weight_t>::max()— as a host-computedkernel argument. This was guarded by
FIXMEcomments noting it should switch tocuda::std::numeric_limits<weight_t>::max()once CUDA 10.2 was the baseline.That baseline has long been met, so this PR resolves the
FIXMEs by computing thelimit on-device instead of threading it through as a parameter.
Changes
weight_t infinityparameter fromkernel_rowReduction,kernel_columnReduction,kernel_dualUpdate_1, andkernel_dualUpdate_2.cuda::std::numeric_limits<weight_t>::max()directly inside those kernels(for the running-minimum initializers and the
d_sp_min[spid] < infinityguard).std::numeric_limits<weight_t>::max()arguments at the call sites in
lap_functions.cuh.#include <cuda/std/limits>and delete the four resolvedFIXMEcomments.No functional or numerical behavior change — the sentinel value is identical; it is
now sourced on the device rather than passed from the host.
Testing
No new tests are required; this is a non-functional refactor covered by the existing
suite. Verified locally:
SOLVERS_TESTbuilds clean.Raft.Hungarian*LAP tests pass (IntFloat,IntDouble,IntLong,LongFloat,LongDouble,LongLong).