Skip to content

Free unlocked buffers before tests run in rng quality tests #3151

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 2 commits into from
Jun 22, 2021

Conversation

9prady9
Copy link
Member

@9prady9 9prady9 commented Jun 22, 2021

Description

This is needed when running rng quality tests on lesser memory cards
where higher memory usage is causing out of memory issues.

Changes to Users

None

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • [ ] Functions added to unified API
  • [ ] Functions documented

This is needed when running rng quality tests on lesser memory cards
where higher memory usage is causing out of memory issues.
@9prady9 9prady9 added this to the 3.8.1 milestone Jun 22, 2021
@9prady9 9prady9 requested a review from umar456 June 22, 2021 09:40
@@ -18,7 +18,7 @@ template<typename T>
class RandomEngine : public ::testing::Test {
public:
virtual void SetUp() {
//Ensure all unlocked buffers are freed
// Ensure all unlocked buffers are freed
deviceGC();
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to unlock all buffers, you need to add af::sync() before the deviceGC().
Without the sync, the buffers which are still in use by executing kernels will not be freed.

Copy link
Member Author

Choose a reason for hiding this comment

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

That is not the case with deviceGC in this location. When test finishes, all arrays involved are already evaluated because they need to be brought to host for comparison. So, they will be marked as unused by the time this line hits before the next test starts.

Copy link
Member

Choose a reason for hiding this comment

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

Additionally all allocation and free function are device synchronization events.

@9prady9 9prady9 merged commit bde5bd2 into arrayfire:master Jun 22, 2021
@9prady9 9prady9 deleted the fix_rng_quality_tests branch June 22, 2021 15:10
9prady9 added a commit to 9prady9/arrayfire that referenced this pull request Aug 2, 2021
…e#3151)

* Free unlocked buffers before tests run in rng quality tests

This is needed when running rng quality tests on lesser memory cards
where higher memory usage is causing out of memory issues.

* Fix formatting

(cherry picked from commit bde5bd2)
syurkevi pushed a commit that referenced this pull request Dec 28, 2021
* Free unlocked buffers before tests run in rng quality tests

This is needed when running rng quality tests on lesser memory cards
where higher memory usage is causing out of memory issues.

* Fix formatting

(cherry picked from commit bde5bd2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants