Skip to content

[rocm6.4_internal_testing] [ROCm] Improvements for vectorized elementwise kernels (#143269) #1874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2025
Merged

Conversation

jerrymannil
Copy link

  • 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 17, 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)
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)
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