CUDA: Add device-side tests for Python builtins (abs, min, max, bool)…#729
Open
CodersAcademy006 wants to merge 11 commits intoNVIDIA:mainfrom
Open
CUDA: Add device-side tests for Python builtins (abs, min, max, bool)…#729CodersAcademy006 wants to merge 11 commits intoNVIDIA:mainfrom
CodersAcademy006 wants to merge 11 commits intoNVIDIA:mainfrom
Conversation
…NVIDIA#515) Adds kernel-based tests for device-side execution of common Python builtins (abs, min, max, bool) on supported dtypes. Tests are skipped under cudasim and use NumPy as the ground truth. This improves CUDA test parity and references issue NVIDIA#515.
Contributor
Greptile SummaryAdds device-side CUDA tests for Python builtins (
All previously identified concerns are style-related (extra blank lines, bounds check consistency patterns) and have been documented in prior review threads. The implementation is functionally correct and adds valuable test coverage. Confidence Score: 4/5
Important Files Changed
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- Remove defensive bounds checking from kernels (trust Python validation) - Add explicit size validation in _launch_1d helper (fail loud) - Replace CPU zero allocation with direct device_array_like/device_array - Remove redundant cuda.synchronize() (copy_to_host implicitly syncs) - Add test_min_float_edge_cases for NaN and signed zero handling - Improve test efficiency and compiler correctness verification
…uplicate test_abs_int definition\n- Use only if i < out.size: in min_kernel and max_kernel (Python enforces size)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.
This PR adds kernel-based tests for device-side execution of common Python builtins (
abs,min,max,bool) on supported dtypes. The tests are:Skipped under cudasim to avoid simulator/Python semantic mismatches
Compared against NumPy as the ground truth
Focused on CUDA-safe, well-defined builtins only
This improves CUDA test parity and references issue Incomplete Test Coverage in Numba-CUDA #515.