From 72b7b0039f0f80033a4c414bdabd42dfde173372 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Thu, 18 Jul 2024 16:46:03 -0700 Subject: [PATCH 1/2] test(adam): increase iterations with flang-new --- test/trainable_engine_test_m.F90 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/trainable_engine_test_m.F90 b/test/trainable_engine_test_m.F90 index 14af78302..2af894c07 100644 --- a/test/trainable_engine_test_m.F90 +++ b/test/trainable_engine_test_m.F90 @@ -348,14 +348,17 @@ function xor_gate_with_random_weights() result(test_passes) type(trainable_engine_t) trainable_engine real(rkind), parameter :: tolerance = 1.E-02_rkind real(rkind), allocatable :: harvest(:,:,:) -#ifndef __INTEL_COMPILER - integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=500000 - !! Depending on where in the random-number sequence the weights start, this test can pass for lower - !! numbers of iterations, e.g., 400000. Using more iterations gives more robust convergence. -#else +#ifdef __flang__ + integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=700000 + !! This test requires more iterations to pass with LLVM Flang +#elif defined __INTEL_COMPILER integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=49000 !! Reducing num_iterations yields a less robust test, but increasing num_iterations causes this !! test to crash when compiled with the Intel ifx compiler. +#else + integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=500000 + !! Depending on where in the random-number sequence the weights start, this test can pass for lower + !! numbers of iterations, e.g., 400000. Using more iterations gives more robust convergence. #endif integer batch, iter From e8f1aa5c648db2665cbaff0d977f348ad3fe1a62 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Thu, 18 Jul 2024 22:10:26 -0700 Subject: [PATCH 2/2] refac(test): reduce iterations with flang --- test/trainable_engine_test_m.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/trainable_engine_test_m.F90 b/test/trainable_engine_test_m.F90 index 2af894c07..6fc622686 100644 --- a/test/trainable_engine_test_m.F90 +++ b/test/trainable_engine_test_m.F90 @@ -349,12 +349,11 @@ function xor_gate_with_random_weights() result(test_passes) real(rkind), parameter :: tolerance = 1.E-02_rkind real(rkind), allocatable :: harvest(:,:,:) #ifdef __flang__ - integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=700000 - !! This test requires more iterations to pass with LLVM Flang + !! Reducing num_iterations yields a less robust test, but moving away from local minima by + !! increasing num_iterations causes this test to crash when compiled with the flang or ifx compilers. + integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=50000 #elif defined __INTEL_COMPILER integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=49000 - !! Reducing num_iterations yields a less robust test, but increasing num_iterations causes this - !! test to crash when compiled with the Intel ifx compiler. #else integer, parameter :: num_inputs=2, mini_batch_size = 1, num_iterations=500000 !! Depending on where in the random-number sequence the weights start, this test can pass for lower