Support tuple equality in CUDA kernels #401
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.
Contributors can view more details about this message here.
<!-- coderabbit-ai-generated:v1 -->
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->
<a href="https://app.coderabbit.ai/change-stack/NVIDIA/numba-cuda-mlir/pull/401?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a>
<!-- review_stack_entry_end -->
<!-- recent_review_start -->
No actionable comments were generated in the recent review. 🎉
<details>
<summary><strong>ℹ️ Recent review info</strong></summary>
<dl>
<dd>
<details>
<summary><strong>⚙️ Run configuration</strong></summary>
<dl>
<dd>
4600cfce-f755-46bf-a68c-4c425bb0d259</dd>
</dl>
</details>
<details>
<summary><strong>📥 Commits</strong></summary>
<dl>
<dd>
Reviewing files that changed from the base of the PR and between 54013667d7bae06d8c853c0ead8a86ceacaa786d and 5520a0be67a428e92931a202e5aeb8fdcac1117f.
</dd>
</dl>
</details>
<details>
<summary><strong>📒 Files selected for processing: 2</strong></summary>
<dl>
<dd>
src/numba_cuda_mlir/lowering/builtins.py
tests/test_tuple.py
</dd>
</dl>
</details>
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
</dd>
</dl>
</details>
<!-- recent_review_end -->
<!-- walkthrough_start -->
<details>
<summary><strong>📝 Walkthrough</strong></summary>
<dl>
<dd>
important: Tuple equality and inequality now have lowerings for BaseTuple. Tests cover tuple and namedtuple comparisons in CUDA kernels.
Changes: Tuple comparison
|Layer / File(s)|Summary|
|:---|:---|
|Tuple comparison lowering and tests <br> src/numba_cuda_mlir/lowering/builtins.py, tests/test_tuple.py|Tuple equality returns false for different lengths and otherwise compares corresponding elements. Tuple inequality negates equality. Kernel tests cover varied values, element types, nested tuples, empty and mismatched-length tuples, and namedtuples.|
Assessment against linked issues
|Objective|Addressed|Explanation|
|:---|:---|:---|
|[#371] Support tuple equality in a kernel using element-wise equality for equal-length tuples.|✅||
Suggested reviewers: ccam80
</dd>
</dl>
</details>
<!-- walkthrough_end -->
<!-- change_assessment_start -->
Priority: ➖ Normal
<!-- change_assessment_commit:"5520a0be67a428e92931a202e5aeb8fdcac1117f" -->
Change: Bug fix · Severity of issue fixed: Medium
<!-- change_assessment_end -->
<details>
<summary><strong>Merge Risk:</strong> <strong>⚪ Minimal</strong> · up to <code>5520a</code></summary>
<dl>
<dd>
<!-- final_review_risk_start -->
<!-- final_review_risk_label
Merge Risk: ⚪ Minimal · up to 5520a
-->
<!-- final_review_risk_coverage:{"sourceCommitId":"5520a0be67a428e92931a202e5aeb8fdcac1117f","coveredCommitId":"5520a0be67a428e92931a202e5aeb8fdcac1117f","kind":"reviewed"} -->
Tuple equality and inequality have no identified merge-blocking issue; merge after normal checks.
<!-- final_review_risk_end -->
</dd>
</dl>
</details>
<!-- autopilot:start -->
<!-- autopilot:end -->
<!-- tips_start -->
<sub>Comment @coderabbitai help to get the list of available commands.</sub>
<!-- tips_end -->
/ok to test 5520a0be67a428e92931a202e5aeb8fdcac1117f
Doc Preview CI
:---:
Preview removed because the pull request was closed or merged.
<!-- Sticky Pull Request Commentpr-preview -->
LGTM.
brandon-b-miller
atmnp
Lower == and != through unrolled field comparisons, reusing scalar promotions and handling unequal lengths and nested tuples (src/numba_cuda_mlir/lowering/builtins.py:131-161).
Cover the reported kernel plus runtime, mixed-type, empty, nested, namedtuple and NaN comparisons (tests/test_tuple.py:10-65).
Fixes #371.