Repository navigation
Conversation
stellaraccident
approved these changes
Oct 13, 2020
ScottTodd
commented
Oct 13, 2020
| return self->Unpack(absl::MakeConstSpan(self->raw_config().results), | ||
| f_results); | ||
| }, | ||
| py::keep_alive<0, 1>()); |
Member
Author
There was a problem hiding this comment.
Some test failures:
ERROR: test_add_scalar (__main__.VmTest)
VmTest.test_add_scalar
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmpfs/src/github/iree/bindings/python/pyiree/rt/vm_test.py", line 138, in test_add_scalar
result = abi.unpack_results(allocated_results)
RuntimeError: Could not allocate weak reference!
----------------------------------------------------------------------
Ran 9 tests in 2.937s
FAILED (errors=1)
Member
Author
|
This didn't work, and the pyiree code it affected is obsolete now. |
stellaraccident
added a commit
to stellaraccident/iree
that referenced
this pull request
Feb 5, 2021
* Fixes iree-org#3381 * While many programs didn't suffer from this, any time references to the array memory escape to the generational collector, a subsequent collection has a high likelihood of freeing the device prior to the buffer allocated against it. * JAX internally seems to have a heuristic that caches a bunch of things and manually invokes the generational gc. * There were many other things I would like to improve about this code but I held off and just did a targeted bug fix. * The prior attempt (iree-org#3450) failed because with multiple results, it would have tried to get a weak reference to a tuple, which is not permitted. This more manual intervention stitches the keep-alive onto the actual objects that need it.
stellaraccident
added a commit
to stellaraccident/iree
that referenced
this pull request
Feb 5, 2021
* Fixes iree-org#3381 * While many programs didn't suffer from this, any time references to the array memory escape to the generational collector, a subsequent collection has a high likelihood of freeing the device prior to the buffer allocated against it. * JAX internally seems to have a heuristic that caches a bunch of things and manually invokes the generational gc. * There were many other things I would like to improve about this code but I held off and just did a targeted bug fix. * The prior attempt (iree-org#3450) failed because with multiple results, it would have tried to get a weak reference to a tuple, which is not permitted. This more manual intervention stitches the keep-alive onto the actual objects that need it.
stellaraccident
added a commit
to stellaraccident/iree
that referenced
this pull request
Feb 5, 2021
* Fixes iree-org#3381 * While many programs didn't suffer from this, any time references to the array memory escape to the generational collector, a subsequent collection has a high likelihood of freeing the device prior to the buffer allocated against it. * JAX internally seems to have a heuristic that caches a bunch of things and manually invokes the generational gc. * There were many other things I would like to improve about this code but I held off and just did a targeted bug fix. * The prior attempt (iree-org#3450) failed because with multiple results, it would have tried to get a weak reference to a tuple, which is not permitted. This more manual intervention stitches the keep-alive onto the actual objects that need it.
rsuderman
pushed a commit
to rsuderman/iree
that referenced
this pull request
Feb 9, 2021
* Fixes iree-org#3381 * While many programs didn't suffer from this, any time references to the array memory escape to the generational collector, a subsequent collection has a high likelihood of freeing the device prior to the buffer allocated against it. * JAX internally seems to have a heuristic that caches a bunch of things and manually invokes the generational gc. * There were many other things I would like to improve about this code but I held off and just did a targeted bug fix. * The prior attempt (iree-org#3450) failed because with multiple results, it would have tried to get a weak reference to a tuple, which is not permitted. This more manual intervention stitches the keep-alive onto the actual objects that need it.
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.
Fixes #3381 (or at least appears to for me)