Skip to content

Align local vector storage arrays in vec transform - #7162

Merged
bernhardmgruber merged 1 commit into
NVIDIA:mainfrom
bernhardmgruber:fix_vec_transform
Jan 11, 2026
Merged

bernhardmgruber merged 1 commit into
NVIDIA:mainfrom
bernhardmgruber:fix_vec_transform

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented Jan 10, 2026 •

Copy link
Copy Markdown
Contributor

We previously only aligned to alignof(T) and not alignof(T) * vec_size. This wasn't noticed since the compiler just keeps the data in registers anyway. However, in a debug build, the arrays are spilled to local memory so the alignment matters.

Small SASS changes for cub.test.device.transform.lid_0 on sm86 and sm120 but only a few immediates:

<         /*00b0*/                   IMAD.MOV.U32 R8, RZ, RZ, 0x3e2 ;                           /* 0x000003e2ff087424 */
---
>         /*00b0*/                   IMAD.MOV.U32 R8, RZ, RZ, 0x3e6 ;                           /* 0x000003e6ff087424 */
29401c29401
<         /*0220*/                   IMAD.MOV.U32 R8, RZ, RZ, 0x230 ;                           /* 0x00000230ff087424 */
---
>         /*0220*/                   IMAD.MOV.U32 R8, RZ, RZ, 0x234 ;                           /* 0x00000234ff087424 */
29477c29477
<         /*0480*/                   IMAD.MOV.U32 R8, RZ, RZ, 0x213 ;                           /* 0x00000213ff087424 */
---
>         /*0480*/                   IMAD.MOV.U32 R8, RZ, RZ, 0x217 ;                           /* 0x00000217ff087424 */

I am not worried, given we also need the fix for correctness.

Fixes: #7160

@github-actions

This comment has been minimized.

@bernhardmgruber
bernhardmgruber enabled auto-merge (squash) January 11, 2026 19:00
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 21h 24m: Pass: 100%/128 | Total: 6d 20h | Max: 5h 00m | Hits: 57%/176785

See results here.

@bernhardmgruber
bernhardmgruber merged commit b7ebe1e into NVIDIA:main Jan 11, 2026
282 of 285 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Jan 11, 2026
github-actions Bot pushed a commit that referenced this pull request Jan 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Successfully created backport PR for branch/3.2.x:

@bernhardmgruber
bernhardmgruber deleted the fix_vec_transform branch January 11, 2026 20:24
bernhardmgruber added a commit that referenced this pull request Jan 12, 2026
Fixes: #7160
(cherry picked from commit b7ebe1e)

Co-authored-by: Bernhard Manfred Gruber <bernhardmgruber@gmail.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 26, 2026
…rrays in vec transform (NVIDIA/cccl#7162) (NVIDIA/cccl#7163)

Upstream: NVIDIA/cccl@5281dca

HIP counterpart (system/hip): none; the Alignment parameter only serves CUB's vectorized transform (cub part not applicable), and system/hip uses rocPRIM transform. Ported the uninitialized_array Alignment template parameter in system/cuda/detail/core/util.h. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 29, 2026
…rrays in vec transform (NVIDIA/cccl#7162) (NVIDIA/cccl#7163)

Upstream: NVIDIA/cccl@5281dca

HIP counterpart (system/hip): none; the Alignment parameter only serves CUB's vectorized transform (cub part not applicable), and system/hip uses rocPRIM transform. Ported the uninitialized_array Alignment template parameter in system/cuda/detail/core/util.h. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 29, 2026
…rrays in vec transform (NVIDIA/cccl#7162) (NVIDIA/cccl#7163)

Upstream: NVIDIA/cccl@5281dca

HIP counterpart (system/hip): none; the Alignment parameter only serves CUB's vectorized transform (cub part not applicable), and system/hip uses rocPRIM transform. Ported the uninitialized_array Alignment template parameter in system/cuda/detail/core/util.h. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 30, 2026
…rrays in vec transform (NVIDIA/cccl#7162) (NVIDIA/cccl#7163)

Upstream: NVIDIA/cccl@5281dca

HIP counterpart (system/hip): none; the Alignment parameter only serves CUB's vectorized transform (cub part not applicable), and system/hip uses rocPRIM transform. Ported the uninitialized_array Alignment template parameter in system/cuda/detail/core/util.h. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Beanavil pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 30, 2026
…rrays in vec transform (NVIDIA/cccl#7162) (NVIDIA/cccl#7163)

Upstream: NVIDIA/cccl@5281dca

HIP counterpart (system/hip): none; the Alignment parameter only serves CUB's vectorized transform (cub part not applicable), and system/hip uses rocPRIM transform. Ported the uninitialized_array Alignment template parameter in system/cuda/detail/core/util.h. test/ counterpart: none. Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
amd-jmahovsky added a commit to ROCm/rocm-libraries that referenced this pull request Nov 4, 2026
…rrays in vec transform (NVIDIA/cccl#7162)

Upstream: NVIDIA/cccl@b7ebe1e

- Already ported: identical to branch/3.2.x backport 5281dcaefdc, ported locally as 9e88cdc
- HIP counterpart: none needed (handled when the backport was ported)
- test/ counterpart: none needed (upstream change has no tests)
- Not compiled, tests not run (autonomous no-build mode)

Co-Authored-By: Claude <noreply@anthropic.com>
amd-jmahovsky added a commit to ROCm/rocm-libraries that referenced this pull request Nov 4, 2026
…rrays in vec transform (NVIDIA/cccl#7162)

Upstream: NVIDIA/cccl@b7ebe1e

- Already ported: identical to branch/3.2.x backport 5281dcaefdc, ported locally as 9e88cdc
- HIP counterpart: none needed (handled when the backport was ported)
- test/ counterpart: none needed (upstream change has no tests)
- Not compiled, tests not run (autonomous no-build mode)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[BUG]: Unaligned access in debug build of vectorized transform

3 participants