Skip to content
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

Use GPU-friendly rounding #591

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Use GPU-friendly rounding #591

merged 1 commit into from
Jun 19, 2024

Conversation

pxl-th
Copy link
Member

@pxl-th pxl-th commented Jun 15, 2024

  • Use GPU-friendly rounding.
    Otherwise we create boxed value that is used for reporting exceptions which triggers hostcalls on AMDGPU.
  • Use Int for indexing (as it is default anyway) instead of converting to UInt32.

Fixes #573.

PR Checklist

  • Tests are added
  • Documentation, if applicable

Copy link
Member

@mcabbott mcabbott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way this could have a test?

And are you reasonably sure that changing UInt32 to Int won't hurt CUDA cases? I don't know why that was written that way, it looks odd to me, but haven't investigated original PR etc.

@pxl-th
Copy link
Member Author

pxl-th commented Jun 19, 2024

Is there any way this could have a test?

Test that would check we are not launching hostcalls on AMDGPU?

And are you reasonably sure that changing UInt32 to Int won't hurt CUDA cases? I don't know why that was written that way, it looks odd to me, but haven't investigated original PR etc.

I think that was me being obsessed with keeping Int32 indexing back then. It might save us a few registers, but beyond that there should be no visible performance impact.
We are still producing Int64 with that code, because @index returns them, so does size(..) and so on.

@pxl-th pxl-th merged commit 425cc59 into master Jun 19, 2024
12 of 15 checks passed
@pxl-th pxl-th deleted the pxl-th/upsample branch June 19, 2024 15:53
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.

Warning on using Upsample on AMDGPU
2 participants