Skip to content

Use vectorized loads from SMEM in bulk copy DeviceTransform kernel #8227

Closed

Description

@bernhardmgruber

As suggested by @pauleonix and some people from DevTech, we could use vectorized loads from SMEM in the bulk copy kernel of cub::DeviceTransform. This may improve performance for workloads using small data types (like I8, I16, FP16, BF16, etc.).

Activity

  1. bernhardmgruber commented on Mar 31, 2026

    @bernhardmgruber
    ContributorAuthor

    Since the bulk copy kernel tunes the items per thread at runtime, we could introduce a vector length tuning parameter and make sure the items per thread are a multiple of it. This way, we always end up with whole vectors in the kernel.

  2. bernhardmgruber commented on Jun 16, 2026

    @bernhardmgruber
    ContributorAuthor

    There is a hidden dependency though, between SMEM and input pointers. Data in SMEM is only aligned if the input pointers are also aligned, since bulk copy will retain any misalignment mod 16 (we can only shift input bytes by multiples of 16 bytes when loading from GMEM to SMEM). Therefore, vectorizing loads from SMEM to registers requires alignment of the input pointers.

    Furthermore, from a discussion with @ahendriksen, it seems vectorization of SMEM loading has the largest benefit for 1 and 2 byte data types.

  3. bernhardmgruber commented on Jun 16, 2026

    @bernhardmgruber
    ContributorAuthor

    Related PR: #9481

  4. moved this from Todo to In Progress in CCCLon Jul 3, 2026
  5. moved this from In Progress to In Review in CCCLon Jul 3, 2026
  6. moved this from In Review to Done in CCCLon Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions