Fix wrong usage of GetScratchBuffer - #2101
Merged
Merged
Conversation
auto p = GetScratchBuffer<T>(size).get(); which cause cuda memory freed immediately, but p will be used later. This also cause random error.
ke1337
reviewed
Oct 11, 2019
|
|
||
| auto condition_cumulative_sum = GetScratchBuffer<int32_t>(valid_condition_length).get(); | ||
| auto condition_cumulative_sum_buffer = GetScratchBuffer<int32_t>(valid_condition_length); | ||
| auto condition_cumulative_sum = condition_cumulative_sum_buffer.get(); |
Contributor
There was a problem hiding this comment.
condition_cumulative_sum_buffer [](start = 34, length = 31)
Thanks for the fix. Do we know why it was not caught by tests? How can we prevent future errors like this?
ybrnathan
approved these changes
Oct 11, 2019
yufenglee
approved these changes
Oct 11, 2019
yuslepukhin
pushed a commit
that referenced
this pull request
Mar 17, 2026
## Describe your changes - Not used at all and maintained. - Same as #2101 but additional files removed ## Checklist before requesting a review - [ ] Add unit tests for this change. - [ ] Make sure all tests can pass. - [ ] Update documents if necessary. - [ ] Lint and apply fixes to your code by running `lintrunner -a` - [ ] Is this a user-facing change? If yes, give a description of this change to be included in the release notes. - [ ] Is this PR including examples changes? If yes, please remember to update [example documentation](https://github.com/microsoft/Olive/blob/main/docs/source/examples.md) in a follow-up PR. ## (Optional) Issue link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the error pattern looks like:
auto p = GetScratchBuffer(size).get();
which cause cuda memory freed immediately, but p will be used later.
This also cause random error.