[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Fix for review



Hello,
I found that the test case failure is not due to incorrect behavior but rather seems like it is because of platform-specific floating-point precision differences on ppc64le. The numerical error is marginal and well within acceptable limits for floating-point operations involving matrix decompositions and pseudo-inverses.

This appears to be a case where the test's absolute epsilon (1e-5) is a bit strict for some platforms, especially when fallback to the normal pseudo-inverse occurs (as the fast pseudo-inverse fails). The same issue also appears to be for arm64.

To resolve this, I suggest for relaxing the epsilon slightly. Following is the diff for that.

diff --git a/unittest/ztensor_cp_test.cc b/unittest/ztensor_cp_test.cc
index e9f9a0f..4cd8446 100644
--- a/unittest/ztensor_cp_test.cc
+++ b/unittest/ztensor_cp_test.cc
@@ -26,6 +26,9 @@ TEST_CASE("ZCP") {
   // double epsilon = fmax(1e-10, std::numeric_limits<double>::epsilon());
   double epsilon = 1e-5;
 
+  #if defined(__PPC64__) || defined(__powerpc64__)
+    epsilon = 2e-5;
+  #endif
   ztensor Z3(3, 2, 4);
   std::ifstream inp3(__dirname + "/z-mat3D.txt");
   if (inp3.is_open()) {
debian@ltc-zz14-lp9:~/test-btas/btas-1.0.0/debian/patches$

Thanks and regards.



Reply to: