This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1686 - Failing tests with -ffast-math -funsafe-math-optimizations
Summary: Failing tests with -ffast-math -funsafe-math-optimizations
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: General (show other bugs)
Version: 3.4 (development)
Hardware: All All
: Normal Failed Unit Test
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-23 08:19 UTC by Gael Guennebaud
Modified: 2019-12-04 18:31 UTC (History)
3 users (show)



Attachments

Description Gael Guennebaud 2019-02-23 08:19:18 UTC
For the record, I tried gcc7 with -ffast-math -funsafe-math-optimizations and here is what I got (number in parenthesis are line numbers):

	 33 - packetmath_1 (464) (numext::isnan)(data2[0])
	 34 - packetmath_2 (678) internal::predux_any(internal::pload<Packet>(data1)) && "internal::predux_any(0101)"
	217 - array_cwise_4 (452) (Eigen::isinf)(m4/zero).all()
	337 - stable_norm_3 (219) (numext::isnan)(numext::hypot(nan,a))
	338 - stable_norm_4 "
	339 - stable_norm_5 (216) verifyIsApprox(numext::hypot(big,big), sqrt2*numext::abs(big))
	340 - stable_norm_6 "
	341 - stable_norm_1 (94) !(numext::isfinite)(sqrt(-abs(big)))
	342 - stable_norm_2 "
	380 - inverse_7 (80) verifyIsApprox(m1, m2.inverse())
	424 - schur_real_1 (97) test_is_equal(rsNaN.info(), NoConvergence, true)
	427 - schur_real_4 "
	436 - eigensolver_selfadjoint_13 (174) test_is_equal(eiSymmNaN.info(), NoConvergence, true)
	437 - eigensolver_selfadjoint_2 "
	438 - eigensolver_selfadjoint_3 "
	439 - eigensolver_selfadjoint_4 "
	440 - eigensolver_selfadjoint_5 "
	441 - eigensolver_selfadjoint_9 "
	450 - eigensolver_complex_1 (140) (ei3.eigenvectors().transpose()*ei3.eigenvectors().transpose()).eval().isIdentity()
	451 - eigensolver_complex_2 "
	453 - eigensolver_complex_4 "
	471 - jacobisvd_7 (308) sub(some_inf, some_inf) != sub(some_inf, some_inf)
	477 - jacobisvd_10 "
	484 - bdcsvd_7 -> variable
	485 - bdcsvd_8 -> variable
	490 - bdcsvd_10 -> (308) sub(some_inf, some_inf) != sub(some_inf, some_inf)
	510 - geo_quaternion_3 (infinite loop in JacobiSVD)
	629 - umeyama_6 (Not Run)
	649 - prec_inverse_4x4_2 (24) error == 0.0
	650 - prec_inverse_4x4_3 "
	672 - half_float (159) !(half(1.0) < half(0.0 / 0.0))
	708 - boostmultiprec_10 svd_common.h (308) sub(some_inf, some_inf) != sub(some_inf, some_inf)

This is mostly for curiosity I don't plan to invest time on them, but if someone care you know where to start.

Also note that with gcc ours built-in isnan/isfinite/isinf are OK with fast-math (unlike the std:: versions)
Comment 1 Christoph Hertzberg 2019-02-25 10:29:57 UTC
I guess we should try to avoid the infinite loops. But overall, we may just warn that compiling with `-ffast-math` is generally not a good idea with Eigen (and usually does not generate benefits). We also had/have several ICC issues, which were essentially caused by aggressive math-optimizations (most recent I recall is Bug 1588).
Comment 2 Nobody 2019-12-04 18:31:33 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1686.

Note You need to log in before you can comment on or make changes to this bug.