Closed StoeckOverflow closed 4 months ago
Hi @StoeckOverflow, thanks for this pull request!
The error message [ no kernels registered for operation `ewIsNan` ]
indicates that DAPHNE looks for a kernel that is registered for the operation ewIsNan
(case-sensitive). However, the kernel catalog (materialized in lib/catalog.json
) contains kernels for the operation ewIsnan
. The simplest solution is to change the mnemonic of the DaphneIR operation to ewIsnan
in src/ir/daphneir/DaphneOps.td
.
For some background: The catalog file is generated automatically by src/runtime/local/kernels/genKernelInst.py
from the information in src/runtime/local/kernels.json
. In the latter file, we specify the op codes of the elementwise unary operations to pre-compile like they are spelled in the respective C++ enum, i.e., in upper case letters. When deriving the DaphneIR operation names, genKernelInst.py
(line 153) takes the first letter in upper case and all remaining letter in lower case, which makes sense for virtually all op codes.
Hi @pdamme, Thank you for your detailed explanation!
I have implemented the suggested change by modifying the mnemonic of the DaphneIR operation to ewIsnan in src/ir/daphneir/DaphneOps.td. I am pleased to report that this has resolved the issue. All tests have passed successfully, and the pull request is now ready for review.
This Draft PR introduces the
isNan
function to the Daphne project, enabling element-wise NaN checks on matrices (see issue #768) . The function has been implemented and successfully tested in C++ unit tests.However, there is an issue with invoking the
isNan
function from a Daphne script, which needs to be resolved.Implemented Features
IsNanOp
operation in DaphneIR as a subclass ofEwUnaryOp
(elementwise unary operation) (seesrc/ir/daphneir/DaphneOps.td
).isNan
and documented it (seesrc/parser/daphnedsl/DaphneDSLBuiltins.cpp
anddoc/DaphneDSL/Builtins.md
).isNan
for matrices and scalars and documented it (seesrc/api/python/daphne/operator/nodes/matrix.py
,src/api/python/daphne/operator/nodes/scalar.py
, anddoc/DaphneLib/APIRef.md
).isNan
by extending the existingewUnaryMat
andewUnarySca
kernel with a new op code (seesrc/runtime/local/kernels/EwUnaryMat.h
).Issues
The current implementation works in C++ unit tests but fails when invoked from a Daphne script with the following error:
This is the module_fail.log:
Next Steps and Feedback
I am currently investigating the kernel registration issue and ensuring proper integration. Any insights or suggestions on this matter would be greatly appreciated. Thank you for your time and assistance in reviewing this PR.