GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — Compile UDFs under Numba's numpy error model by eriknw · Pull Request #588 · python-graphblas/python-graphblas Conversation
Member
A UDF that divides by zero silently corrupted the result. Numba's default The float case is the same shape: Pass This changes what a dividing UDF returns, but the behaviour it replaces is Stack created with GitHub Stacks CLI • Give Feedback 💬
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
eriknw
marked this pull request as ready for review
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
2 times, most recently
from
2d14098 to
c4adb70
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
2 times, most recently
from
6908f99 to
b5525f1
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
b5525f1 to
e7721a6
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
2 times, most recently
from
d9bf85c to
fb5254d
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
fb5254d to
c877578
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
c877578 to
c24208c
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
2 times, most recently
from
0861b81 to
d895629
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
d895629 to
ae5ca33
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
ae5ca33 to
611eab0
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
611eab0 to
53eb255
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
53eb255 to
35c4009
Compare
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
35c4009 to
d8dfc4a
Compare
Base automatically changed from
07-selectop-borrowed-handle-lifetime
to
main
A UDF that divides by zero silently corrupted the result. Numba's default error model raises ZeroDivisionError inside the cfunc, where Numba prints the traceback and returns without writing, so GraphBLAS keeps whatever the output element already held. Measured at 6f1eb02: def _idiv(x, y): return x // y op = BinaryOp.register_anonymous(_idiv, "_probe_idiv") op(Vector.from_coo([0, 1], [10, 20]) & Vector.from_coo([0, 1], [2, 0])).new() -> [5, 5] # numpy gives [5, 0]; the 5 is the previous element The float case is the same shape: `[0.5, 0.5]` where numpy gives `[0.5, inf]`. The only user-visible signal is an "Exception ignored" traceback on stderr. Pass `error_model="numpy"` at every `numba.njit` and `numba.cfunc` site for user-defined ops. Setting it on the cfunc alone is not enough: `_build` calls `.compile(sig)` on the Dispatcher first, a Dispatcher keeps one compilation per signature, and whichever compile happens first fixes the model. Reverting only the Dispatcher argument, leaving it on the cfunc, reproduces `[5, 5]`. This changes what a dividing UDF returns, but the behaviour it replaces is an unwritten element rather than an error, so there is no correct result being taken away.
eriknw
force-pushed
the
08-numba-numpy-error-model
branch
from
d8dfc4a to
7f9f3f3
Compare
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |