Skip to content

Conversation

@jerrymannil
Copy link
Collaborator

  • Make io_size calculation as minimum of size of input and output size, rather than the summation of all sizes
    • for e.g, for torch.add() on half dtypes (bfloat16/float16), calc_io_size() returns 6 causing elems_per_thread to be 4
    • But elems_per_thread = 8 works better on half datypes for AMD gpus
  • Enable *_load_dwordx4 ISA for 16-bit and 8-bit dtypes on AMD gpus by using vector size of 8 and 16 respectively

Co-author: @akadutta

Pull Request resolved: pytorch#143269
Approved by: https://github.com/jeffdaily, https://github.com/pruthvistony

*  Make io_size calculation as minimum of size of input and output size, rather than the summation of all sizes
   * for e.g, for torch.add() on half dtypes (bfloat16/float16), calc_io_size() returns 6 causing elems_per_thread to be 4
   * But elems_per_thread = 8 works better on half datypes for AMD gpus
* Enable *_load_dwordx4 ISA for 16-bit and 8-bit dtypes on AMD gpus by using vector size of 8 and 16 respectively

Co-author: @akadutta

Pull Request resolved: pytorch#143269
Approved by: https://github.com/jeffdaily, https://github.com/pruthvistony

Co-authored-by: Pruthvi Madugundu <[email protected]>
@pruthvistony pruthvistony merged commit 4686828 into ROCm:rocm6.4_internal_testing Jan 31, 2025
@BLOrange-AMD BLOrange-AMD changed the title [ROCm] Improvements for vectorized elementwise kernels (#143269) [rocm6.4_internal_testing] [ROCm] Improvements for vectorized elementwise kernels (#143269) Feb 7, 2025
dnikolaev-amd pushed a commit that referenced this pull request Apr 24, 2025
… (#1874)

* Make io_size calculation as minimum of size of input and output size,
rather than the summation of all sizes
* for e.g, for torch.add() on half dtypes (bfloat16/float16),
calc_io_size() returns 6 causing elems_per_thread to be 4
   * But elems_per_thread = 8 works better on half datypes for AMD gpus
* Enable *_load_dwordx4 ISA for 16-bit and 8-bit dtypes on AMD gpus by
using vector size of 8 and 16 respectively

Co-author: @akadutta

Pull Request resolved: pytorch#143269
Approved by: https://github.com/jeffdaily,
https://github.com/pruthvistony

Co-authored-by: Pruthvi Madugundu <[email protected]>
(cherry picked from commit 4686828)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants