daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
67 stars 62 forks source link

Inconsistent results when dividing by 0 #802

Open Garic152 opened 3 months ago

Garic152 commented 3 months ago

Description:

When using the `outerDiv' function on matrices filled with zeros, we get an exception (most likely from C++), but no custom error message from daphne. This is only the case when dividing two scalar integers.

Examples:

  1. Using the outerDiv function with two matrices filled with zeros:

    X = rand(10, 10, 0, 2, 0, -1);
    Y = rand(10, 10, 0, 2, 0, -1);
    
    Z = X / Y;

    Output:

    Floating point exception
  2. Using the / functionality with two scalar zero floats:

    print(0.0 / 0.0);

    Output:

    nan

3, Using the / functionality with two scalar zero integers:

   print(0 / 0);

Output:

   [error]: Lowering pipeline error.CanonicalizerPass (mlir::daphne::EwDivOp::fold) failed with the following message [ Can't divide by 0 ]

To my knowledge, the first 2 examples should be caught by daphne and throw a custom error message like in the third example.