-
Notifications
You must be signed in to change notification settings - Fork 55
CUDA: Add device-side tests for Python builtins (abs, min, max, bool)… #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
CUDA: Add device-side tests for Python builtins (abs, min, max, bool)… #729
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.
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 3 comments
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 2 comments
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 4 comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.