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 AttributeError on LocalBuffer.__delete__ call in python xla client #26345

Merged
merged 1 commit into from Mar 5, 2019

Conversation

neerajprad
Copy link
Contributor

While playing around with some custom JAX primitives, I was noticing the python xla client throwing exceptions like below towards the end (probably when LocalBuffer is gc'd or in a separate cleanup operation). The exceptions are ignored, but they are logged many times in the code that I am working with. This adds a small check (taken from the Executable class) to ensure that c_api hasn't already been freed in the LocalBuffer.delete() method.

Exception ignored in: <bound method LocalBuffer.__del__ of <jaxlib.xla_client.LocalBuffer object at 0x1267a55c0>>
Traceback (most recent call last):
  File "/Users/npradhan/miniconda3/envs/numpyro/lib/python3.6/site-packages/jaxlib/xla_client.py", line 393, in __del__
  File "/Users/npradhan/miniconda3/envs/numpyro/lib/python3.6/site-packages/jaxlib/xla_client.py", line 377, in delete
  File "/Users/npradhan/miniconda3/envs/numpyro/lib/python3.6/site-packages/jaxlib/xla_client.py", line 104, in delete_buffer
AttributeError: 'NoneType' object has no attribute 'DeleteLocalShapedBuffer'

cc. @hawkinsp

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@neerajprad
Copy link
Contributor Author

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.

Signed!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Mar 5, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Mar 5, 2019
@rthadur rthadur self-assigned this Mar 5, 2019
@rthadur rthadur added this to Assigned Reviewer in PR Queue via automation Mar 5, 2019
@rthadur rthadur added the ready to pull PR ready for merge process label Mar 5, 2019
@tensorflow-copybara tensorflow-copybara merged commit bed882f into tensorflow:master Mar 5, 2019
PR Queue automation moved this from Assigned Reviewer to Merged Mar 5, 2019
tensorflow-copybara pushed a commit that referenced this pull request Mar 5, 2019
PiperOrigin-RevId: 236921620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes ready to pull PR ready for merge process
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants