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

Memory leak fix for multiple rocPRIM unit tests #614

Merged

Conversation

NguyenNhuDi
Copy link
Collaborator

Adding missing hip free calls and fixing hip graph calls.

@NguyenNhuDi
Copy link
Collaborator Author

This is not the completed PR. I still need to add more fixes as I go through the tickets

@NguyenNhuDi NguyenNhuDi changed the base branch from develop to release-staging/rocm-rel-6.3 October 3, 2024 21:16
Copy link
Collaborator

@stanleytsang-amd stanleytsang-amd left a comment

Choose a reason for hiding this comment

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

@NguyenNhuDi Please look into the test failures in CI - they are global across all pipelines and are in files modified by your PR

@NguyenNhuDi
Copy link
Collaborator Author

PR still WIP, some sort of sync errors are causing CI failures

@NguyenNhuDi NguyenNhuDi changed the title Memory leak fix for multiple rocPRIm unit tests Memory leak fix for multiple rocPRIM unit tests Oct 15, 2024
@NguyenNhuDi
Copy link
Collaborator Author

PR is done, waiting for ci tests and aproval

Copy link
Collaborator

@umfranzw umfranzw left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning up the graph tests. I just have one small comment below.

test/rocprim/test_utils_hipgraphs.hpp Show resolved Hide resolved
Copy link
Collaborator

@umfranzw umfranzw left a comment

Choose a reason for hiding this comment

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

I think this looks good now.

@NguyenNhuDi NguyenNhuDi merged commit c8744fa into ROCm:release-staging/rocm-rel-6.3 Oct 17, 2024
24 checks passed
NguyenNhuDi added a commit that referenced this pull request Nov 1, 2024
* Remove website URL from comments (#600)

Referencing or using code from some websites is prohibited in this repository.
This change removes an informational reference in the comments.

* Fix rare memory access faults when using internal serial merge (#597)

* test: add tests for internal serial merge function

* refactor(detail/merge_path.hpp): removed code duplication

* fix(detail/merge_path.hpp): stricter boundary checking in serial merge

* fix(detail/block_sort_merge.hpp): fix missing block-wide sync

During a previous refactor, serial_merge does no longer do a block sync. This has now been re-added.

* feat: add unsafe variant of serial merge

* fix: use bounded version for serial merge to fix rare page faults

* test(test_internal_merge_path): clean up internal merge path tests

* style: standardize range_t<> construction

* fix(detail/merge_path.hpp): fix 'range_t<>::count1()' and 'range_t<>::count2()' return types to be same as encapsulated type

* perf(detail/merge_path.hpp): use const ref in function parameters

* refactor(detail/merge_path.hpp): replace redundant use of 'OffsetT' with 'unsigned int'

* chore: update changelog

* fix: restore missing thread sync

This got removed during a rebase.

* Add gfx1151 target (#601) (#603)

Co-authored-by: Stanley Tsang <stanley.tsang@amd.com>

* Merge back 6.2 hotfixes (#607) (#620)

* Update dependency names for static builds (#557)

This also removes the line setting `BUILD_SHARED_LIBS` to `ON`, which was previously required to get the correctly named packages when not specifically compiling for a static build. Updates to the ROCmCMakeBuildTools (rocm-cmake) should mean this is no longer necessary.

* Fix BUILD_SHARED_LIBS for packaging (#558)

* Fix the dependencies of the static packages (#563)

* cmake: don't set CMAKE_C_COMPILER, as rocPRIM is a CXX project (#567)

* add developer guidelines (#555) (#574)



* Update Read the Docs config to Python 3.10 and latest rocm-docs-core (#564) (#579)

* Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same as warp size (#599)

* Optimize block_reduce_warp_reduce when block size == warp size

* Make conditional constexpr

* Fix conflict in concepts.rst

---------

Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>
Co-authored-by: Steve Leung <Steve.Leung@amd.com>
Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com>
Co-authored-by: Nol Moonen <nol@streamhpc.com>
Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>

* Changed precondition for edge case in serial_merge to prevent assertion error (#622)

* added std::min to ensure no out of bound acess

* fixed typo keys->keys1

* updated changelog

* reverted std::min

* implemented suggested logic

* edited to conform to standards (#618)

* Memory leak fix for multiple rocPRIM unit  tests (#614)

* fixed mem leak in test_config_dispatch.cpp

* added missing hip free for method==4 in test_block_scan.kernels

* added graphHelpeer class that does not cause memory leak due to using hipGraphCreate

* replaced old hipGraph helpers with new class in device_bin_search

* changed HIP_CHECK_NON_VOID to HIP_CHECK

* fixed mem leak in device_bin_search

* added additional functions

* changed out old calls to hipGraphCrete to new GraphHelper class

* added missing stream sync for hipgrag_algs

* n

* added missing hipFree and HIP_CHECK for lookback_reproducibility

* added missing hipFree in test_discard_iterator

* fixed test failures

* removed extra hipFree

* removed unused variables

* updated change log

* removed redundant function

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: root <root@x1001c6s0b1n0.hostmgmt2001.cm.lockhart.amd.com>

* changed to using gHelper

* merged 6.3 version of merge_sort_merge_path (failing large indices test)

* updated mergepath to have fix for large indices

* updated the changelog for 6.3 (#632)

* updated changelog for test_utils_hipgraph change

* updated changelog

---------

Co-authored-by: Wayne Franz <wayfranz@amd.com>
Co-authored-by: Nara <nara@streamhpc.com>
Co-authored-by: amd-garydeng <garydeng@amd.com>
Co-authored-by: Stanley Tsang <stanley.tsang@amd.com>
Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>
Co-authored-by: Steve Leung <Steve.Leung@amd.com>
Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com>
Co-authored-by: Nol Moonen <nol@streamhpc.com>
Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
Co-authored-by: spolifroni-amd <Sandra.Polifroni@amd.com>
Co-authored-by: Your Name <you@example.com>
Co-authored-by: root <root@x1001c6s0b1n0.hostmgmt2001.cm.lockhart.amd.com>
stanleytsang-amd added a commit that referenced this pull request Nov 21, 2024
* Remove website URL from comments (#600)

Referencing or using code from some websites is prohibited in this repository.
This change removes an informational reference in the comments.

* Fix rare memory access faults when using internal serial merge (#597)

* test: add tests for internal serial merge function

* refactor(detail/merge_path.hpp): removed code duplication

* fix(detail/merge_path.hpp): stricter boundary checking in serial merge

* fix(detail/block_sort_merge.hpp): fix missing block-wide sync

During a previous refactor, serial_merge does no longer do a block sync. This has now been re-added.

* feat: add unsafe variant of serial merge

* fix: use bounded version for serial merge to fix rare page faults

* test(test_internal_merge_path): clean up internal merge path tests

* style: standardize range_t<> construction

* fix(detail/merge_path.hpp): fix 'range_t<>::count1()' and 'range_t<>::count2()' return types to be same as encapsulated type

* perf(detail/merge_path.hpp): use const ref in function parameters

* refactor(detail/merge_path.hpp): replace redundant use of 'OffsetT' with 'unsigned int'

* chore: update changelog

* fix: restore missing thread sync

This got removed during a rebase.

* Add gfx1151 target (#601) (#603)

Co-authored-by: Stanley Tsang <stanley.tsang@amd.com>

* Merge back 6.2 hotfixes (#607) (#620)

* Update dependency names for static builds (#557)

This also removes the line setting `BUILD_SHARED_LIBS` to `ON`, which was previously required to get the correctly named packages when not specifically compiling for a static build. Updates to the ROCmCMakeBuildTools (rocm-cmake) should mean this is no longer necessary.

* Fix BUILD_SHARED_LIBS for packaging (#558)

* Fix the dependencies of the static packages (#563)

* cmake: don't set CMAKE_C_COMPILER, as rocPRIM is a CXX project (#567)

* add developer guidelines (#555) (#574)



* Update Read the Docs config to Python 3.10 and latest rocm-docs-core (#564) (#579)

* Cherry-pick: Optimize block_reduce_warp_reduce when block size is the same as warp size (#599)

* Optimize block_reduce_warp_reduce when block size == warp size

* Make conditional constexpr

* Fix conflict in concepts.rst

---------

Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>
Co-authored-by: Steve Leung <Steve.Leung@amd.com>
Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com>
Co-authored-by: Nol Moonen <nol@streamhpc.com>
Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>

* Changed precondition for edge case in serial_merge to prevent assertion error (#622)

* added std::min to ensure no out of bound acess

* fixed typo keys->keys1

* updated changelog

* reverted std::min

* implemented suggested logic

* edited to conform to standards (#618)

* Memory leak fix for multiple rocPRIM unit  tests (#614)

* fixed mem leak in test_config_dispatch.cpp

* added missing hip free for method==4 in test_block_scan.kernels

* added graphHelpeer class that does not cause memory leak due to using hipGraphCreate

* replaced old hipGraph helpers with new class in device_bin_search

* changed HIP_CHECK_NON_VOID to HIP_CHECK

* fixed mem leak in device_bin_search

* added additional functions

* changed out old calls to hipGraphCrete to new GraphHelper class

* added missing stream sync for hipgrag_algs

* n

* added missing hipFree and HIP_CHECK for lookback_reproducibility

* added missing hipFree in test_discard_iterator

* fixed test failures

* removed extra hipFree

* removed unused variables

* updated change log

* removed redundant function

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: root <root@x1001c6s0b1n0.hostmgmt2001.cm.lockhart.amd.com>

* updated the changelog for 6.3 (#632)

* updated default gpu to include gfx12 and gfx1151

* updated changelog

* fixed minor grammar mistake in changelog

* Update CHANGELOG.md

Co-authored-by: spolifroni-amd <Sandra.Polifroni@amd.com>

* Remove gfx940,gfx941 targets (#639)

* Update rocPRIM version

---------

Co-authored-by: Wayne Franz <wayfranz@amd.com>
Co-authored-by: Nara <nara@streamhpc.com>
Co-authored-by: amd-garydeng <garydeng@amd.com>
Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>
Co-authored-by: Steve Leung <Steve.Leung@amd.com>
Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com>
Co-authored-by: Nol Moonen <nol@streamhpc.com>
Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com>
Co-authored-by: Di Nguyen <dinguyennhu@gmail.com>
Co-authored-by: spolifroni-amd <Sandra.Polifroni@amd.com>
Co-authored-by: Your Name <you@example.com>
Co-authored-by: root <root@x1001c6s0b1n0.hostmgmt2001.cm.lockhart.amd.com>
Co-authored-by: Val Movsik <160653499+vamovsik@users.noreply.github.com>
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.

3 participants