spark-instrumented-optimizer/mllib
Kousuke Saruta 3267b17713 [SPARK-35530][ML][TESTS] Fix rounding error in DifferentiableLossAggregatorSuite with Java 11
### What changes were proposed in this pull request?

This PR fixes an test failure of `DifferentiableLossAggregatorSuite` with Java 11.

### Why are the changes needed?

I'm personally checking whether all the tests pass with Java 11 for the current master and I found DifferentiableLossAggregatorSuite fails.
https://github.com/sarutak/spark/runs/2661859541?check_suite_focus=true#step:9:13895

The reason seems that the implementation of Blas.daxpy is different between for Java 8 and Java 11. For Java 11, `Math.fma` is used.

https://github.com/luhenry/netlib/blob/v2.2.0/blas/src/main/java/dev/ludovic/netlib/blas/Java8BLAS.java#L92
0053ea30b1/blas/src/main/java/dev/ludovic/netlib/blas/Java11BLAS.java (L40)

To remove the rounding error, this PR changes `TestAggregator.add` with fma.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

I confirmed `DifferentiableLossAggregatorSuite` passes with both Java 8 and Java 11.

Closes #32673 from sarutak/fix-rounding-error.

Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
2021-05-28 11:39:24 +09:00
..
benchmarks [SPARK-34950][TESTS] Update benchmark results to the ones created by GitHub Actions machines 2021-04-03 23:02:56 +03:00
src [SPARK-35530][ML][TESTS] Fix rounding error in DifferentiableLossAggregatorSuite with Java 11 2021-05-28 11:39:24 +09:00
pom.xml [SPARK-35295][ML] Replace fully com.github.fommil.netlib by dev.ludovic.netlib:2.0 2021-05-12 08:59:36 -05:00