Skip to content

TestFlatSys.test_kinematic_car_ocp[basis3-prev-None-trust-constr] fails on aarch64 #918

Open

Description

@ggardet

TestFlatSys.test_kinematic_car_ocp[basis3-prev-None-trust-constr] fails on openSUSE Tumbleweed aarch64, apparently because The maximum number of function evaluations is exceeded.:

[  225s] =================================== FAILURES ===================================
[  225s] ______ TestFlatSys.test_kinematic_car_ocp[basis3-prev-None-trust-constr] _______
[  225s] 
[  225s] self = <control.tests.flatsys_test.TestFlatSys object at 0xffff90722850>
[  225s] vehicle_flat = <FlatSystem:sys[3596]:['v', 'delta']->['x', 'y', 'theta']>
[  225s] basis = <BSplineFamily: nvars=None, degree=[8], smoothness=[7]>, guess = 'prev'
[  225s] constraints = None, method = 'trust-constr'
[  225s] 
[  225s]     @pytest.mark.parametrize(
[  225s]         "basis, guess, constraints, method", [
[  225s]         (fs.PolyFamily(8, T=10), 'prev', None, None),
[  225s]         (fs.BezierFamily(8, T=10), 'linear', None, None),
[  225s]         (fs.BSplineFamily([0, 10], 8), None, None, None),
[  225s]         (fs.BSplineFamily([0, 10], 8), 'prev', None, 'trust-constr'),
[  225s]         (fs.BSplineFamily([0, 10], [6, 8], vars=2), 'prev', None, None),
[  225s]         (fs.BSplineFamily([0, 5, 10], 5), 'linear', None, 'slsqp'),
[  225s]         (fs.BSplineFamily([0, 10], 8), None, ([8, -0.1], [12, 0.1]), None),
[  225s]         (fs.BSplineFamily([0, 5, 10], 5, 3), None, None, None),
[  225s]     ])
[  225s]     def test_kinematic_car_ocp(
[  225s]             self, vehicle_flat, basis, guess, constraints, method):
[  225s]     
[  225s]         # Define the endpoints of the trajectory
[  225s]         x0 = [0., -2., 0.]; u0 = [10., 0.]
[  225s]         xf = [40., 2., 0.]; uf = [10., 0.]
[  225s]         Tf = 4
[  225s]         timepts = np.linspace(0, Tf, 10)
[  225s]     
[  225s]         # Find trajectory between initial and final conditions
[  225s]         traj_p2p = fs.point_to_point(
[  225s]             vehicle_flat, Tf, x0, u0, xf, uf, basis=basis)
[  225s]     
[  225s]         # Verify that the trajectory computation is correct
[  225s]         x, u = traj_p2p.eval(timepts)
[  225s]         np.testing.assert_array_almost_equal(x0, x[:, 0])
[  225s]         np.testing.assert_array_almost_equal(u0, u[:, 0])
[  225s]         np.testing.assert_array_almost_equal(xf, x[:, -1])
[  225s]         np.testing.assert_array_almost_equal(uf, u[:, -1])
[  225s]     
[  225s]         #
[  225s]         # Re-solve as optimal control problem
[  225s]         #
[  225s]     
[  225s]         # Define the cost function (mainly penalize steering angle)
[  225s]         traj_cost = opt.quadratic_cost(
[  225s]             vehicle_flat, None, np.diag([0.1, 10]), x0=xf, u0=uf)
[  225s]     
[  225s]         # Set terminal cost to bring us close to xf
[  225s]         terminal_cost = opt.quadratic_cost(
[  225s]             vehicle_flat, 1e3 * np.eye(3), None, x0=xf)
[  225s]     
[  225s]         # Implement terminal constraints if specified
[  225s]         if constraints:
[  225s]             input_constraints = opt.input_range_constraint(
[  225s]                 vehicle_flat, *constraints)
[  225s]         else:
[  225s]             input_constraints = None
[  225s]     
[  225s]         # Use a straight line as an initial guess for the trajectory
[  225s]         if guess == 'prev':
[  225s]             initial_guess = traj_p2p.eval(timepts)[0][0:2]
[  225s]         elif guess == 'linear':
[  225s]             initial_guess = np.array(
[  225s]                 [x0[i] + (xf[i] - x0[i]) * timepts/Tf for i in (0, 1)])
[  225s]         else:
[  225s]             initial_guess = None
[  225s]     
[  225s]         # Solve the optimal trajectory
[  225s]         traj_ocp = fs.solve_flat_ocp(
[  225s]             vehicle_flat, timepts, x0, u0,
[  225s]             cost=traj_cost, constraints=input_constraints,
[  225s]             terminal_cost=terminal_cost, basis=basis,
[  225s]             initial_guess=initial_guess,
[  225s]             minimize_kwargs={'method': method},
[  225s]         )
[  225s]         xd, ud = traj_ocp.eval(timepts)
[  225s]     
[  225s]         if not traj_ocp.success:
[  225s]             # Known failure cases
[  225s]             if re.match(".*precision loss.*", traj_ocp.message):
[  225s]                 pytest.xfail("precision loss in some configurations")
[  225s]     
[  225s]             elif re.match("Iteration limit.*", traj_ocp.message) and \
[  225s]                  re.match(
[  225s]                      "conda ubuntu-3.* Generic", os.getenv('JOBNAME', '')) and \
[  225s]                  re.match("1.24.[012]", np.__version__):
[  225s]                 pytest.xfail("gh820: iteration limit exceeded")
[  225s]     
[  225s]             else:
[  225s]                 # Dump out information to allow creation of an exception
[  225s]                 print("Message:", traj_ocp.message)
[  225s]                 print("Platform:", platform.platform())
[  225s]                 print("Python:", platform.python_version())
[  225s]                 print("NumPy version:", np.__version__)
[  225s]                 np.show_config()
[  225s]                 print("JOBNAME:", os.getenv('JOBNAME'))
[  225s]     
[  225s] >               pytest.fail(
[  225s]                     "unknown failure; view output to identify configuration")
[  225s] E               Failed: unknown failure; view output to identify configuration
[  225s] 
[  225s] control/tests/flatsys_test.py:227: Failed
[  225s] ----------------------------- Captured stdout call -----------------------------
[  225s] Message: The maximum number of function evaluations is exceeded.
[  225s] Platform: Linux-6.3.7-1-default-aarch64-with-glibc2.37
[  225s] Python: 3.9.16
[  225s] NumPy version: 1.24.2
[  225s] blas_armpl_info:
[  225s]   NOT AVAILABLE
[  225s] blas_mkl_info:
[  225s]   NOT AVAILABLE
[  225s] blis_info:
[  225s]   NOT AVAILABLE
[  225s] openblas_info:
[  225s]   NOT AVAILABLE
[  225s] accelerate_info:
[  225s]   NOT AVAILABLE
[  225s] atlas_3_10_blas_threads_info:
[  225s]   NOT AVAILABLE
[  225s] atlas_3_10_blas_info:
[  225s]   NOT AVAILABLE
[  225s] atlas_blas_threads_info:
[  225s]   NOT AVAILABLE
[  225s] atlas_blas_info:
[  225s]   NOT AVAILABLE
[  225s] blas_info:
[  225s]     libraries = ['cblas', 'blas', 'blas']
[  225s]     library_dirs = ['/usr/lib64']
[  225s]     include_dirs = ['/usr/local/include']
[  225s]     language = c
[  225s]     define_macros = [('HAVE_CBLAS', None)]
[  225s] blas_opt_info:
[  225s]     define_macros = [('NO_ATLAS_INFO', 1), ('HAVE_CBLAS', None)]
[  225s]     libraries = ['cblas', 'blas', 'blas']
[  225s]     library_dirs = ['/usr/lib64']
[  225s]     include_dirs = ['/usr/local/include']
[  225s]     language = c
[  225s] lapack_armpl_info:
[  225s]   NOT AVAILABLE
[  225s] lapack_mkl_info:
[  225s]   NOT AVAILABLE
[  225s] openblas_lapack_info:
[  225s]   NOT AVAILABLE
[  225s] openblas_clapack_info:
[  225s]   NOT AVAILABLE
[  225s] flame_info:
[  225s]   NOT AVAILABLE
[  225s] atlas_3_10_threads_info:
[  225s]   NOT AVAILABLE
[  225s] atlas_3_10_info:
[  225s]   NOT AVAILABLE
[  225s] atlas_threads_info:
[  225s]   NOT AVAILABLE
[  225s] atlas_info:
[  225s]   NOT AVAILABLE
[  225s] lapack_info:
[  225s]     libraries = ['lapack', 'lapack']
[  225s]     library_dirs = ['/usr/lib64']
[  225s]     language = f77
[  225s] lapack_opt_info:
[  225s]     libraries = ['lapack', 'lapack', 'cblas', 'blas', 'blas']
[  225s]     library_dirs = ['/usr/lib64']
[  225s]     language = c
[  225s]     define_macros = [('NO_ATLAS_INFO', 1), ('HAVE_CBLAS', None)]
[  225s]     include_dirs = ['/usr/local/include']
[  225s] Supported SIMD extensions in this NumPy install:
[  225s]     baseline = NEON,NEON_FP16,NEON_VFPV4,ASIMD
[  225s]     found = ASIMDHP,ASIMDDP
[  225s]     not found = ASIMDFHM
[  225s] JOBNAME: None
[  225s] =============================== warnings summary ===============================
[  225s] control/tests/flatsys_test.py::TestFlatSys::test_kinematic_car_ocp[basis3-prev-None-trust-constr]
[  225s]   /home/abuild/rpmbuild/BUILD/control-0.9.4/control/flatsys/flatsys.py:882: UserWarning: unable to solve optimal control problem
[  225s]   scipy.optimize.minimize: 'The maximum number of function evaluations is exceeded.'
[  225s]     warnings.warn(
[  225s] 
[  225s] control/tests/freqresp_test.py::test_superimpose
[  225s]   /home/abuild/rpmbuild/BUILD/control-0.9.4/control/tests/freqresp_test.py:129: UserWarning: Attempt to set non-positive xlim on a log-scaled axis will be ignored.
[  225s]     plt.clf()
[  225s] 
[  225s] control/tests/optimal_test.py::test_optimal_doc[shooting-3-None-xfail]
[  225s] control/tests/optimal_test.py::test_optimal_doc[shooting-3-zero-xfail]
[  225s]   /home/abuild/rpmbuild/BUILD/control-0.9.4/control/optimal.py:928: UserWarning: unable to solve optimal control problem
[  225s]   scipy.optimize.minimize returned Positive directional derivative for linesearch
[  225s]     warnings.warn(
[  225s] 
[  225s] control/tests/xferfcn_test.py::TestXferFcn::test_printing_zpk[zeros5-poles5-0-\n0\n-\n1\n]
[  225s]   /usr/lib64/python3.9/site-packages/scipy/signal/_filter_design.py:1746: BadCoefficients: Badly conditioned filter coefficients (numerator): the results may be meaningless
[  225s]     warnings.warn("Badly conditioned filter coefficients (numerator): the "
[  225s] 
[  225s] control/tests/xferfcn_test.py::TestXferFcn::test_printing_zpk[zeros5-poles5-0-\n0\n-\n1\n]
[  225s]   /usr/lib64/python3.9/site-packages/scipy/signal/_filter_design.py:1091: RuntimeWarning: invalid value encountered in divide
[  225s]     b /= b[0]
[  225s] 
[  225s] -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
[  225s] =========================== short test summary info ============================
[  225s] SKIPPED [1] control/tests/frd_test.py:519: pandas not installed
[  225s] SKIPPED [1] control/tests/matlab2_test.py:204: skipping test_check_convert_shape, need to update test
[  225s] SKIPPED [1] control/tests/matlab2_test.py:275: need to update test
[  225s] SKIPPED [1] control/tests/passivity_test.py:14: cvxopt not installed
[  225s] SKIPPED [1] control/tests/passivity_test.py:31: cvxopt not installed
[  225s] SKIPPED [1] control/tests/passivity_test.py:41: cvxopt not installed
[  225s] SKIPPED [1] control/tests/passivity_test.py:62: cvxopt not installed
[  225s] SKIPPED [1] control/tests/passivity_test.py:83: cvxopt not installed
[  225s] SKIPPED [5] control/tests/passivity_test.py:101: cvxopt not installed
[  225s] SKIPPED [1] control/tests/passivity_test.py:113: cvxopt not installed
[  225s] SKIPPED [1] control/tests/passivity_test.py:124: cvxopt not installed
[  225s] SKIPPED [1] control/tests/passivity_test.py:132: cvxopt not installed
[  225s] SKIPPED [1] control/tests/statesp_test.py:185: obsolete test
[  225s] SKIPPED [4] control/tests/timeresp_test.py:418: test system does not settle
[  225s] SKIPPED [6] control/tests/timeresp_test.py:874: No continuous forced_response without time vector.
[  225s] SKIPPED [1] control/tests/timeresp_test.py:1179: pandas not installed
[  225s] SKIPPED [1] control/tests/type_conversion_test.py:163: future test; conversions not yet fully implemented
[  225s] SKIPPED [1] control/tests/xferfcn_test.py:90: outdated test
[  225s] SKIPPED [2] control/tests/xferfcn_test.py:741: .__matmul__ not implemented
[  225s] XFAIL control/tests/flatsys_test.py::TestFlatSys::test_kinematic_car[basis3] - reason: system is open loop unstable => errors can build
[  225s] XFAIL control/tests/lti_test.py::TestLTI::test_timebaseEqual_deprecated[None-True-True] - returns false
[  225s] XFAIL control/tests/optimal_test.py::test_optimal_doc[shooting-3-None-xfail] - reason: optimization fails to converge
[  225s] XFAIL control/tests/optimal_test.py::test_optimal_doc[shooting-3-zero-xfail] - reason: optimization fails to converge
[  225s] XFAIL control/tests/optimal_test.py::test_optimal_doc[shooting-3-input-endpoint] - reason: optimization does not converge to endpoint
[  225s] XFAIL control/tests/optimal_test.py::test_optimal_doc[shooting-5-input-endpoint] - reason: optimization does not converge to endpoint
[  225s] XFAIL control/tests/optimal_test.py::test_optimal_doc[collocation-3-u0-endpoint] - reason: optimization does not converge to endpoint
[  225s] XFAIL control/tests/optimal_test.py::test_optimal_doc[collocation-5-u0-endpoint] - reason: optimization does not converge to endpoint
[  225s] XFAIL control/tests/statefbk_test.py::TestStatefbk::testLQR_warning - warning not implemented
[  225s] XFAIL control/tests/statefbk_test.py::TestStatefbk::testDLQR_warning - warning not implemented
[  225s] FAILED control/tests/flatsys_test.py::TestFlatSys::test_kinematic_car_ocp[basis3-prev-None-trust-constr]
[  225s] = 1 failed, 3381 passed, 32 skipped, 1 deselected, 10 xfailed, 6 warnings in 177.78s (0:02:57) =

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions