You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use vectorized loads from SMEM in bulk copy DeviceTransform kernel #8227
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.).
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.
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.
Activity
bernhardmgruber commentedon Mar 31, 2026
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.
bernhardmgruber commentedon Jun 16, 2026
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.
bernhardmgruber commentedon Jun 16, 2026
Related PR: #9481