You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Floating point exception in mxnet.ndarray.op.random_pdf_poisson #18937
(A clear and concise description of what the bug is.) mxnet.ndarray.op.random_pdf_poisson has floating point exception when given lam is shape (0,). Please see the provided code snippet for example.
Error Message
(Paste the complete error message. Please also include stack trace by setting environment variable DMLC_LOG_STACK_TRACE_DEPTH=10 before running your script.)
Floating point exception (core dumped)
To Reproduce
(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)
@xidulu same question as #18936 (comment), since we are deprecating ndarray in favor of np/npx, do we need to register an alias of this op in np/npx? (or is it already registered)
@szha
As far as I am concerned, pdf ops are not registered under npx yet and I don't think its that necessary because:
This series of ops do not have very good support for numpy's broadcasting and zero-dim/size (as is shown in this issue) semantics, which could cause great confusion for users.
Secondly, if users would have access to pdf ops, they could now use the pdf operator inside the probability module.
Activity
szha commentedon Aug 21, 2020
Here's the problem:
https://github.com/apache/incubator-mxnet/blob/9bdd4d6347c284770ee5bfe5ae98f1dabc283829/src/operator/random/pdf_op.h#L469
The code needs to guard against zero-size array for right operand of
%, and we should add a smoke test to guard against such problem in this op, similar to https://github.com/apache/incubator-mxnet/pull/18972/files.szha commentedon Aug 21, 2020
@xidulu same question as #18936 (comment), since we are deprecating ndarray in favor of np/npx, do we need to register an alias of this op in np/npx? (or is it already registered)
xidulu commentedon Aug 21, 2020
@szha
As far as I am concerned, pdf ops are not registered under
npxyet and I don't think its that necessary because:xidulu commentedon Aug 21, 2020
Btw, a possible solution for this bug could be adding a zero-size check (e.g. https://github.com/apache/incubator-mxnet/blob/master/src/operator/numpy/random/np_normal_op.h#L320) before the kernel launch: https://github.com/apache/incubator-mxnet/blob/master/src/operator/random/pdf_op.h#L514
fix apache#18936 and apache#18937
[BUGFIX] fix #18936, #18937 (#19878)
szha commentedon Apr 30, 2021
fixed in the above PR