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

Fix storage of non-POD random distributions. #5395

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

mzient
Copy link
Contributor

@mzient mzient commented Mar 26, 2024

Category:

Bug fix (non-breaking change which fixes an issue)

Description:

Storing dists_cpu_ in a byte buffer results in a resource leak and other potential problems in case of non-trivially-copyable and non-trivially-destructible distributions.

Additional information:

Affected modules and functionalities:

Random number generators.

Key points relevant for the review:

Tests:

test_random_choice
test_uniform
test_noise_gaussian

The fix was validated by running a selected test form test_random_choice with valgrind.
CI validation happens in a sanitizer build.

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [13803979]: BUILD STARTED

@klecki klecki self-requested a review March 26, 2024 15:26
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [13803979]: BUILD PASSED

@klecki
Copy link
Contributor

klecki commented Mar 26, 2024

CI validation happens in a sanitizer build.

Did you trigger the sanitizer build?

@mzient
Copy link
Contributor Author

mzient commented Mar 27, 2024

CI validation happens in a sanitizer build.

Did you trigger the sanitizer build?

There's no need, strictly speaking. Valgrind confirmed the former leak, which disappeared after the fix. We'll get a confirmation in a nightly.

@klecki
Copy link
Contributor

klecki commented Mar 27, 2024

CI validation happens in a sanitizer build.

Did you trigger the sanitizer build?

There's no need, strictly speaking. Valgrind confirmed the former leak, which disappeared after the fix. We'll get a confirmation in a nightly.

I would say that if you are posting a fix, you should confirm that it works in CI before merging. If the problem was in L1 test, you would trigger the job rather than wait for the nightly to see if it worked, right?

@mzient
Copy link
Contributor Author

mzient commented Mar 27, 2024

CI validation happens in a sanitizer build.

Did you trigger the sanitizer build?

There's no need, strictly speaking. Valgrind confirmed the former leak, which disappeared after the fix. We'll get a confirmation in a nightly.

I would say that if you are posting a fix, you should confirm that it works in CI before merging. If the problem was in L1 test, you would trigger the job rather than wait for the nightly to see if it worked, right?

That's one way of looking at it. The way I see it, I'm not fixing CI. I'm fixing a memory leak / undefined behavior / ... I'm confident that the tools I used to verify the fix are sufficient. If you feel insecure about this code, feel free to trigger the build. It's not a mandatory part of the team-approved merging process.

@klecki
Copy link
Contributor

klecki commented Mar 27, 2024

CI validation happens in a sanitizer build.

Did you trigger the sanitizer build?

There's no need, strictly speaking. Valgrind confirmed the former leak, which disappeared after the fix. We'll get a confirmation in a nightly.

I would say that if you are posting a fix, you should confirm that it works in CI before merging. If the problem was in L1 test, you would trigger the job rather than wait for the nightly to see if it worked, right?

That's one way of looking at it. The way I see it, I'm not fixing CI. I'm fixing a memory leak / undefined behavior / ... I'm confident that the tools I used to verify the fix are sufficient. If you feel insecure about this code, feel free to trigger the build.

If you are fixing a specific test, it is a normal practice to run the CI for that test, so all reviewers can see that it works. And I would consider that author responsibility. We have tools for that rather than promising that it works.

It's not a mandatory part of the team-approved merging process.

"A full CI build has been run for the latest commit submitted and all the tests are passing."

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [13827654]: BUILD STARTED

@klecki
Copy link
Contributor

klecki commented Mar 27, 2024

I triggered the sanitizer build.

@mzient
Copy link
Contributor Author

mzient commented Mar 27, 2024

I triggered the sanitizer build.

The relevant job https://gitlab-master.nvidia.com/dl/dali/dali-gh-mirror/-/jobs/87208338 has passed; killing the rest.

@mzient mzient merged commit a41bc63 into NVIDIA:main Mar 27, 2024
5 of 6 checks passed
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.

None yet

5 participants