Skip to content

Comments

Work-around for ROCM overflowing ints when scan-summing arrays#1525

Merged
gunney1 merged 2 commits intodevelopfrom
bugfix/marchingcubes-rocm-overflow
Mar 31, 2025
Merged

Work-around for ROCM overflowing ints when scan-summing arrays#1525
gunney1 merged 2 commits intodevelopfrom
bugfix/marchingcubes-rocm-overflow

Conversation

@gunney1
Copy link
Contributor

@gunney1 gunney1 commented Mar 28, 2025

Summary

  • This PR is a bugfix (work-around)
  • It does the following:
    • Use a totally inefficient 32-bit int to represent a boolean, to work around a ROCM behavior.
    • Add comment about the same work-around for another array.
    • Add notes on when we can remove the work-around.

We have 2 arrays, one with booleans and one with ints in [0,5], but we have to use more bits to represent them for ROCM. We do sum scans on them and put the output in 32-bit ints. However, ROCM is doing the sum in the input type without promoting to the output type. This work-around bumps up the input type.

Related to llnl/RAJA#1631

Add notes about conditions for backing out the work-around.
@gunney1 gunney1 self-assigned this Mar 28, 2025
@gunney1 gunney1 added bug Something isn't working Quest Issues related to Axom's 'quest' component GPU Issues related to GPU development Hip Issues related to Hip labels Mar 28, 2025
Copy link
Member

@kennyweiss kennyweiss left a comment

Choose a reason for hiding this comment

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

Thanks @gunney1

Clearly, this is necessary.
Other than more memory, are there performance implications?

@kennyweiss
Copy link
Member

kennyweiss commented Mar 31, 2025

Looks like you missed an initialization:

/home/axom/axom/src/axom/core/../../axom/quest/detail/MarchingCubesImpl.hpp:77:7: error: invalid initialization of reference of type 'axom::Array<int>&' from expression of type 'axom::Array<long int>'
   77 |     , m_facetIncrs(facetIncrs)
      |       ^~~~~~~~~~~~~~~~~~~~~~~~

https://dev.azure.com/axom/axom/_build/results?buildId=13141&view=logs&j=0b50086d-0dae-5824-d20c-f0d441949587&t=ebe88c80-2dbb-5dd9-2006-9b9be4efc4c3

@gunney1 gunney1 merged commit 7ab265a into develop Mar 31, 2025
13 checks passed
@gunney1 gunney1 deleted the bugfix/marchingcubes-rocm-overflow branch April 11, 2025 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working GPU Issues related to GPU development Hip Issues related to Hip Quest Issues related to Axom's 'quest' component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants