Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix OMP offload build memory leaks #720

Merged
merged 1 commit into from
Jul 3, 2023
Merged

Fix OMP offload build memory leaks #720

merged 1 commit into from
Jul 3, 2023

Conversation

mewall
Copy link
Collaborator

@mewall mewall commented Jun 28, 2023

o bml_add_ellpack arrays allocated but not freed
o bml_multiply_ellpack arrays allocated but not freed o Also increase efficiency of a target region in bml_prune_rocsparse_ellpack

Copy link
Collaborator

@jeanlucf22 jeanlucf22 left a comment

Choose a reason for hiding this comment

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

I don't understand the changes in formatting... It is passing the tests as is, but was also passing the tests before.

@mewall
Copy link
Collaborator Author

mewall commented Jun 29, 2023

I don't understand the changes in formatting... It is passing the tests as is, but was also passing the tests before.

Me neither. I just ran indent in the docker container and that's what it came up with...

@jmohdyusof
Copy link
Collaborator

What don't you understand? I see the old version had incorrect indents (not multiple of 4) plus missing spaces after commas etc. In Python the linters do weird line breaks sometimes, but I didn't see anything obvious here (but there are a lot of lines)

@mewall
Copy link
Collaborator Author

mewall commented Jun 29, 2023 via email

@jmohdyusof
Copy link
Collaborator

I have seen things like this when the local line length limit is different across machines so one linter breaks the line and then it gets unwrapped in github.
The main changes look to be the 'enter data' and 'target' clauses being added, plus the addition of the 'exit data' and deallocation of arrays?

@mewall
Copy link
Collaborator Author

mewall commented Jun 29, 2023 via email

@jmohdyusof
Copy link
Collaborator

Was the enter/exit data missing for all the offload options or just for rocm? If for all, we probably should sweep the code and check for similar errors.

@mewall
Copy link
Collaborator Author

mewall commented Jun 29, 2023 via email

@jmohdyusof
Copy link
Collaborator

Just to make sure I am clear, these are local work arrays that need to persist for a while, not the original arrays that should be allocated in allocate_typed or wherever?

@mewall
Copy link
Collaborator Author

mewall commented Jun 29, 2023 via email

@jmohdyusof
Copy link
Collaborator

OK, so probably there isn't a similar issue in other routines, but doesn't hurt to check. Thx!

o Fix leaks seen in running progress benchmarks
  - bml_add_ellpack arrays allocated but not freed
  - bml_multiply_ellpack arrays allocated but not freed
o Fix similar leaks in other subroutines
o Also increase efficiency of a target region in bml_prune_rocsparse_ellpack
@mewall
Copy link
Collaborator Author

mewall commented Jun 29, 2023 via email

@mewall
Copy link
Collaborator Author

mewall commented Jun 29, 2023

OK, so probably there isn't a similar issue in other routines, but doesn't hurt to check. Thx!

I found some other offload build routines where it was needed, ones that aren't used by the progress benchmark.

The latest revision addresses these other cases.

@mewall
Copy link
Collaborator Author

mewall commented Jun 29, 2023

I don't understand the changes in formatting... It is passing the tests as is, but was also passing the tests before.

I found we aren't lint checking the *_typed.c files. I backed out the formatting changes so we can address this as a separate issue. We might want to see whether we can start lint checking these files again in the future.

@mewall mewall linked an issue Jun 29, 2023 that may be closed by this pull request
@mewall
Copy link
Collaborator Author

mewall commented Jul 3, 2023

@jeanlucf22 @nicolasbock Can this be merged? I have another PR based on this branch that I'd like to initiate, I'd like to do that after this is merged to avoid any confusion with the diffs.

@jeanlucf22 jeanlucf22 merged commit 5aa44ec into master Jul 3, 2023
@jeanlucf22 jeanlucf22 deleted the fix_memory_leaks branch July 3, 2023 18:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leaks in offload build
4 participants