Skip to content

AOCL 2.2 changes - Majorly include LAPACK 3.9.0 support - #36

Open
rsanagap wants to merge 1542 commits into
flame:masterfrom
amd:master
Open

AOCL 2.2 changes - Majorly include LAPACK 3.9.0 support#36
rsanagap wants to merge 1542 commits into
flame:masterfrom
amd:master

Conversation

@rsanagap

@rsanagap rsanagap commented Jul 5, 2020

Copy link
Copy Markdown

Field,

Please review and merge them.

Thanks

venkatesha and others added 30 commits February 5, 2025 01:25
Removed older version netlib-test suite from AOCL-LAPACK.
Removed netlib test suite versions are lapack-3.4.2, lapack-3.9.0 and lapack-3.10.0
Removed unused /src/map/lapack2flamec/f2c/netlib/3.5.0.tar file

Signed-off-by: Venkatesha <vprasada@amd.com>
AMD-Internal: [CPUPL-4863]
Change-Id: I982d59f169cb42c60cf6a7b63729edeff3fd4461
Previously, -fopenmp flag was always added to the compiler flag when multi-threading was enabled. This Update modifies the CMake build system to include -fopenmp only when openmp is linked through EXT_OPENMP_LIB. This change is applicable to only CMake build system.

Signed-off-by: Sridhar Govindaswamy <Sridhar.Govindaswamy@amd.com>
Change-Id: Ic0ea9739ecf368bb946665fa7668ec31af974698
This commit fixes High impact errors reported in
Coverity report for Feb b1.

1. There was a valid code error in sgedmd.c where
   a variable was not initialized. Initialized variable
   as per netlib LAPACK refernce.
2. There was a false positive variable unitialized error
   in slarrd. Initialized the variable to zero in order
   to  surpress future error report.

Change-Id: I8b94d2e61a9849dff08cfbded590413089b111ee
Signed-off-by: samahmad <Sameer.Ahmad@amd.com>
AMD-Internal: CPUPL-5672
Updated CMake build to include -fopenmp flag to the compiler flag only on linux system. This check was missed in  patch 1185904.

Signed-off-by: Sridhar Govindaswamy <Sridhar.Govindaswamy@amd.com>
Change-Id: I21aa2978192ceccfcef9efddc18c0b537cda096e
- Fix SyntaxWarning messages from python 3.12 in flatten-headers.py
- Remove file execute permission from src/aocl_dtl/Makefile
- Remove control characters in section 6 of test/main/ReadMe.txt
- Correct typo in comments in some test files

Change-Id: Ib7cb8c4056009e9d6d58a140d167bcc3a02f5bcf
Following changes
 - AOCL_ROOT can now be used to set both AOCL-BLAS and AOCL-Utils paths.
   Test suite would use the same too.
 - If LIBAOCLUTILS_LIBRARY_PATH is provided by user, the same
   will override AOCL_ROOT for AOCL-Utils library
 - If CMAKE_EXT_BLAS_LIBRARY_DEPENDENCY_PATH is provided by user,
   - The same will be used if ENABLE_AOCL_BLAS is not set
   - Ignored if ENABLE_AOCL_BLAS is set. Instead will use BLAS
     path from AOCL_ROOT

AMD-Internal: [CPUPL-5530]

Change-Id: I6fe7fd037b28f38e89eb0afbd33489ea6f27350d
Updated early return checks and reset info value in lapack_dgelqf.c

Signed-off-by: Venkatesha <vprasada@amd.com>
AMD-Internal: [CPUPL-6388]
Change-Id: I5709a40e9738807bc95091b1ba0d1484cc6ed454
   1. Division of two pointer variable holding the same address , one variable getting updated value and another variable not updating due to that we are experiencing
      wrong results. To avoid that the numerator variable copy into local variable before division would solve the issue.

AMD Internal : [CPUPL-5915]

Change-Id: I532dc852061ba184438e7f89da8890aaae591e4f
Included netlib lapack 3.12 test suite support to window.

Signed-off-by: Venkatesha <vprasada@amd.com>
Change-Id: Ieda921505d570df8b4ca16f1ecac2ac5f344d1c3
Updating DTL log to new macro based statments

Signed-off-by: Venkatesha <vprasada@amd.com>
AMD-Internal: [CPUPL-6333]
Change-Id: I7b7a4ad386382d57c52b2621f98f022b6a505b87
NAN checks added in fringe kernel cases in DLARFG
optimized code. This enables propagation of NAN values
to the output norm from inputs.

Change-Id: I107ac1921d38dd598b61f794dbbffd9a79b10205
Printing of test results moved to validate functions
to have flexibility of printing intermediate results.
Only failed cases are added for printing.

AMD Internal: CPUPL-4319

Change-Id: I2181d95d46f34e30e0e4447c493f312e7a86f5f2
Benchmarked DGESDD for differnt threads and sizes.
Size thresholds derived from the data to choose optimal
number of threads for different sub modules/APIs.
Affected APIs are DORMQR, DORMLQ and DLABRD.

Signed-off-by: Vasanthakumar R <varajago@amd.com>
AMD-Internal: CPUPL-5828

Change-Id: Ie87b1174eafc3c181fdda916bbfe469337b40f75
1. Updated dsyevd(), dlaed4() and dlaed6() to store machine machine parameters in static varaiables.
2. Optimized for loop blocks in dlaed4().

Change-Id: I8aa14f34b09727cda1d7eb97053c0e7e6181168a
Signed-off-by: Sridhar Govindaswamy <Sridhar.Govindaswamy@amd.com>
DGELS was not correctly recognizing singular matrix due to precision error from dgeqrf and dlarf APIs

This commit makes the following changes to resolve the issue

1. Changing SSE/AVX2/AVX512 fmadd instructions in dgeqrf and dlarf to serparate multiply and addition operations.
2. Changes to the vector kernels of dgeqrf and dlarf to improve performance.
3. Further, a change has been made in validate_sygvd to correct OV/UV testing.
4. With the current change, existing netlib-test errors are reduced. But addition 2 errors are introduced for
   DEV and 12 errors for DVX. These errors only show in netlib-tests with the custom ilaenv parameters defined
   for these tests. With the default ilaenv values of libflame, all these tests passes.

Change-Id: I75f7448fc731bdeffa64515c4f9bf4231b78f652
Signed-off-by: samahmad Sameer.Ahmad@amd.com
AMD-Internal: CPUPL-5869
libflame_interface.hh file split into multiple files each
contain different categories of APIs. The split files are
named according to the categories.
Missing APIs were added into libflame_interface.hh where
the other split .hh files are also included via #include
directive.

AMD-Internal: CPUPL-6373
Change-Id: Id725721470bcefbe63bc3a165824d6ac2d166e04
For static library build of AOCL-LAPACK, the header path of AOCL-Utils
is sufficient. But recent changes made in usage of AOCL_ROOT forced setting
AOCL-Utils path as well. Fixed the same

AMD-Internal: CPUPL-6421
Change-Id: I4b5d98dffd6f02ea8b0a5406b279adc3474772da
Generating consolidated libflame_interface.hh file during configure time.

AMD-Internal: CPUPL-6373
Change-Id: I95a3421a2d19d1f4ff4fd6bb7728fd6b80086e6f
In cmake file to set dependent libraries path, the variable name
for AOCL-Utils was wrongly set in Windows path section. This was
causing issue in static library generation. Fixed the same. Also
fixed incorrect header path for AOCL-Utils under Windows OS config.

AMD-Internal: CPUPL-6424

Change-Id: Id0e4223e63ae6102099455eb6aea111af89897f5
Updated validate function to support new status printing macro,
in case of n = 0

Signed-off-by: Venkatesha <vprasada@amd.com>
AMD-Internal: [CPUPL-6423]
Change-Id: I1ca509c3ef2bc9a8202a4d619ac97ce139bc5c27
Fix for [unused-variable] and [used uninitialized] found in windows build

Signed-off-by: Venkatesha <vprasada@amd.com>
Change-Id: Ib028834275adbaf0a1bf4b039525dd321f4bb480
The commit make the following changes:

1. Change libflame package name to aocl-lapack.
2. Change dependent blis package name to aocl-blas.
3. Use aocl-blas/aocl-blas-mt based on threading
   config.
4. aocl-lapack pc file is now genreated in
   "{CMAKE_INSTALL_PREFIX}/pkgconfig/" dir instead
   of "{CMAKE_INSTALL_PREFIX}/share/pkgconfig/"
4. The following error is fixed:
   "Error in running lapack tests, when linking to
   AOCL-BLAS using pkgconfig"
5. Using Python3 module instead of hardcoded
   python executable.

Change-Id: I021d67a1ddbb79b6d8d0b5d39a3b676e17fdeb7a
Signed-off-by: samahmad <Sameer.Ahmad@amd.com>
AMD-Internal: CPUPL-6426
The vector kernels of LANGE were not correctly handling NaN values
as per reference code. This commit makes following changes:

1. For each loaded vector, it will check for Nan values and store
   it in a flag register. After the loop it will check flag, if
   the flag is true then it will return Nan.
2. Enable Extreme test cases for LANGE main test.

Change-Id: I1c0c7f9ba1d9840f9ebea9aa010a09bdda085209
Signed-off-by: samahmad <Sameer.Ahmad@amd.com>
AMD-Internal: CPUPL-6417
-> Fixed DGELSS failure in lapacke_col_major test
	Argument passed to compute_matrix_norm was wrong,
	updated with expected argument.
-> Fixed windows ilp64 build warnings

Signed-off-by: Venkatesha <vprasada@amd.com>
Change-Id: I4f51faadb026a80f3e9c506177a98ac65e5cf592
Updated the doxygen file input path based on recent
cpp changes

Signed-off-by: Venkatesha <vprasada@amd.com>
Change-Id: I395a085b4f14addcbc4e7f022f7bfcf7e7f3903b
-> Fixed DGELSS failure in lapacke_col_major test
Argument passed to compute_matrix_norm was wrong,
updated with expected argument.
-> Fixed windows ilp64 build warnings

Signed-off-by: Venkatesha <vprasada@amd.com>
AMD-Internal: [CPUPL-6442]
Change-Id: I8ccd30c981dafc4d6875dae4f6fb677163c94193
Updated the doxygen file input path based on recent
cpp changes

Signed-off-by: Venkatesha <vprasada@amd.com>
AMD-Internal: [CPUPL-6446]
Change-Id: Iee1361d7c8eff644c2137d5f629c04163a28cdca
The commit make the following changes:

1. Change libflame package name to aocl-lapack.
2. Change dependent blis package name to aocl-blas.
3. Use aocl-blas/aocl-blas-mt based on threading
   config.
4. aocl-lapack pc file is now genreated in
   "{CMAKE_INSTALL_PREFIX}/pkgconfig/" dir instead
   of "{CMAKE_INSTALL_PREFIX}/share/pkgconfig/"
4. The following error is fixed:
   "Error in running lapack tests, when linking to
   AOCL-BLAS using pkgconfig"
5. Using Python3 module instead of hardcoded
   python executable.

Change-Id: I021d67a1ddbb79b6d8d0b5d39a3b676e17fdeb7a
Signed-off-by: samahmad <Sameer.Ahmad@amd.com>
AMD-Internal: CPUPL-6426
(cherry picked from commit 909cad6)
Main test suite is displaying zero error for all GESDD tests.
Updated the residual variables to display correct values.

AMD-Internal: CPUPL-6473
Signed-off-by: dnikku <Deepika.Nikku@amd.com>
Change-Id: I222e0bef09de88cbdd47f7d63910ca3cdf46405a
Main test suite is displaying zero error for all GESDD tests.
Updated the residual variables to display correct values.

AMD-Internal: CPUPL-6473
Signed-off-by: dnikku <Deepika.Nikku@amd.com>
Change-Id: I222e0bef09de88cbdd47f7d63910ca3cdf46405a
(cherry picked from commit e6cf461)
Phanikumar, Nagarapu and others added 30 commits August 20, 2026 09:59
Resolved a numerical error by performing multiplication and accumulation separately
 instead of using FMA in slanv2

Change-Id: I4f181ae301681a542274818950eb4fd5e38b1c8f
test: harden LAPACK validators with padding, input-preservation, and unused-triangle checks
- Stamp & verify LDA>M padding sentinels on every output matrix
- Add [in] argument preservation checks (matrices, IPIV, TAU, scalars)
- Add unused-triangle preservation checks for symmetric/triangular APIs
- Add dedicated validators for previously macro-only routines (gbtrs, gelss, ...)
- Unify check_padding / compare_matrix / compare_vector to return 0.0 (pass) / DBL_MAX (fail), strict-aliasing-safe via unsigned char + memcpy/memcmp
- Fix reset_matrix row-count misuse in test_gels/gelsd/stedc/sytrd
* AOCL LAPACK Test Suite: updated ldb for sygvd in brt tests

* AOCL LAPACK Test Suite: updated copyright latest year

* Added conformance tests for SYGVD

* Updated repeatability tests with BRT=V

* Addressed review comnets by adding min lwork cases, removed few large sizes in negative tests

---------
* Add per-API CTest parallelization for CPP interface tests

The existing CTest parallelization covered LAPACK and LAPACKE
(row/column) interfaces but not the CPP interface. Add per-API
CTest entries for --interface=cpp, guarded by ENABLE_CPP_TEST,
so that `ctest -R cpp_test_long -jN` runs CPP tests in parallel.

* doc: Document LAPACKE and CPP interface CTest name patterns in ReadMe
Updated version string to point to 5.3 release version.
Corrected print format.
Documentation related files also updated with latest version string.
Complex SYGVD routine should be mapped to HEGVD
This commit pulls in Netlib 3.12.1 changes for single precision APIs. 69 APIs affected and 2 new APIs added [slarf1f and slarf1l].

---------
Initialized denominator value to unity to resolve potential uninitialized variable usage
* New files added from Netlib: CLARF1F and CLARF1L

* Updated Netlib 3.12.1 changes to CBDSQR, CGBRFS, CGEBD2, CGEBRD, CGEDMD, CGEHRD, CGELQ2, CGELQF, CGELQ2, CGEMLQ, CGEMQR, CGEQL2, CGEQLF, CGEQP3RK, CGEQR, CGEQR2, CGEQR2P, CGEQRFP, CGERFS, CGERQ2, CGESVDX, CGESVJ, CGETC2, CGETRI, CGETSLS, CGETSQRHRT, CGGES3, CGGEV3, CGGHD3, CGGQRF, CGGRQF, CGTRFS, CHEEQUB, CHEEVR, CHEEVR_2STAGE, CHEEVX, CHERFS, CHESV_AA, CHESV_AA_2STAGE, CHESVX, CHETRD, CHETRD_2STAGE, CHETRD_HB2ST, CHETRD_HE2HB, CHETRF, CHETRF_AA, CHETRF_AA_2STAGE, CHETRF_RK, CHETRI2, CHETRI_3, CHETRS_AA, CHPRFS, CLAHEF, CLAHEF_RK, CLAMSWLQ, CLAMTSQR, CLAQP2, CLAQP2RK, CLAQR2, CLARFGP, CLASWLQ, CLASYF, CLASYF_RK, CLASYF_ROOK, CLATRS3, CLATSQR, CPBRFS, CPORFS, CPPRFS, CPTRFS, CSPRFS, CSYEQUB, CSYRFS, CTBRFS, CTPRFS, CTRRFS, CUNBDB, CUNBDB1, CUNBDB2, CUNBDB3, CUNBDB4, CUNG2L, CUNG2R, CUNGL2, CUNGR2, CUNHR_COL, CUNM2L, CUNML2, CUNMR2 and CUPMTR APIs.

---------
Remove Zen family/model-number based auto ISA detection and use a configure-time C CPUID helper to detect AVX512F, AVX2, or none. Update CMake and documentation for the new auto detection flow.

AMD-Internal: CPUPL-8374
* New API: DLARF1F and DLARF1L added

* Updated netlib changes to DGEBRD, DGEHD2, DGEHRD, DGELQ2, DGELSD, DGEMLQ, DGEMQR, DGEQL2, DGEQLF, DGEQR, DGEQR2, DGEQR2P, DGEQRFP, DGERQ2, DGESVJ, DGETC2, DGETRI, DGETSLS, DGGES3, DGGEV3, DGGHD3, DGGQRF, DGGRQF, DLAMSWLQ, DLAMTSQR, DLAQP2, DLAQP2RK, DLAQR2, DLASWLQ, DLASYF, DLASYF_RK, DLASYF_ROOK, DLATRS3, DLATSQR, DOPMTR, DORBDB, DORBDB1, DORBDB2, DORBDB3, DORBDB4, DORG2L, DORG2R, DORGL2, DORGR2, DORHR_COL, DORM2l, DORM2R, DORML2, DSYEVR, DSYEVR_2STAGE, DSYEVX, DSYSV_AA, DSYSV_AA_2STAGE, DSYSVX, DSYTRD, DSYTRD_2STAGE,  DSYTRD_SY2SB, DSYTRF_AA, DSYTRF_AA_2STAGE, DSYTRI2, DSYTRI_3, DSYTRS_AA, DGETSQRHRT, DSYTRD_SB2ST and DORG2R

---------
* New APIs from Netlib: ZLARF1F and ZLARF1L

* Updated Netlib Changes to ZBDSQR, ZGEBD2, ZGEBRD, ZGEDMD, ZGEHRD, ZGELQ2, ZGEMLQ, ZGEMQR, ZGEQL2, ZGEQLF, ZGEQR, ZGEQR2, ZGEQR2P, ZGEQRFP, ZGERQ2, ZGESVJ, ZGETC2, ZGETRI, ZGETSLS, ZGETSQRHRT, ZGGEV3, ZGGES3, ZGGHD3, ZGGQRF, ZGGRQF, ZHEEVR, ZHEEVR_2STAGE, ZHESV_AA, ZGETSLS, ZHESV_AA_2STAGE, ZHESVX, ZHETRD, ZHETRD_2STAGE, ZHETRD_HB2ST, ZHETRD_HE2HB, ZHETRF, ZHETRF_AA, ZHETRF_AA_2STAGE, ZHETRF_RK, ZHETRI2, ZHETRS_AA, ZLAHEF, ZLAHEF_RK, ZLAMSWLQ, ZLAMTSQR, ZLAQP2, ZLAQP2RK, ZLAQR2, ZLARFGP, ZLASWLQ, ZLASYF, ZLASYF_RK, ZLASYF_ROOK, ZLATRS3, ZLATSQR, ZUNBDB, ZUNBDB1, ZUNBDB2, ZUNBDB3, ZUNBDB4, ZUNG2L, ZUNG2R, ZUNGL2, ZUNGR2, ZUNHR_COL, ZUNM2L, ZUNML2, ZUNMR2 and ZUPMTR

---------
Make libflame buildable as a subdirectory of the parent unified `aocl`
project (FetchContent/add_subdirectory), where the top-level
CMAKE_SOURCE_DIR / CMAKE_BINARY_DIR point at the enclosing project
rather than libflame's own tree.

Source root:
- Capture libflame's own root once as the FLAME_ROOT cache variable and
  use it for every DA-owned path reference, replacing CMAKE_SOURCE_DIR
  throughout CMakeLists.txt and cmake/CompilerFlags.cmake (output dirs,
  generated headers, monolithic-header include paths, BLAS dependency
  path, fmacro-prefix-map, auto_config.py, additional clean files).

BLAS dependency:
- When an in-tree AOCL::BLAS target is already provided by the parent
  build, consume it directly (link the target and take the include dir
  from AOCL_TB_BLAS_INCLUDE_DIR) instead of install-path discovery via
  find_dep_libs.cmake, which fails because BLAS is not installed yet at
  configure time.

Unified build (AOCL_TB_UNIFIED_BUILD):
- Contribute libflame's object files (OBJECT_LIBRARIES) to the single
  libaocl via aocl_tb_add_objects.
- Recompile the main target's own sources into an OBJECT twin with
  aocl_tb_objectify after add_subdirectory(src), so the f2c LAPACK
  translation units compiled straight into the libflame target are also
  contributed to libaocl.

Install:
- Install flame.pc from CMAKE_CURRENT_BINARY_DIR instead of
  CMAKE_BINARY_DIR, since configure_file writes it into this project's
  binary dir (the two differ under the in-tree build).

[ AMD-Internal : CPUPL-8312 ]
* AOCL LAPACK: DSPFFRT2 Optimization for Single Thread

Made following changes:
 - Added vector kernels for dspr operation
 - Updated var1 and var2 kernels to avoid copying from contiguous vector to non contiguous vector.
 - Added a fused vector kernel to copy and scale vectors.
 - Added variant 3 which operates in a left looking manner.
 - Added variant 4, 5 and 6 with nested blocking
 - Added best variant chooser function based on n and ncolm that chooses the best variant using decision tree generated by perf data.
 - Fixed a bug in dorgbr.

 AMD-Internal: CPUPL-7655
-> Reworked the parallel DPOTRF (var2) to operate in-place on the
original matrix, partitioned into NB x NB tiles. No extra tile
buffer is allocated and no explicit packing is performed.
-> Replaced the OpenMP task/depend() scheduling with a lock-free
scheduler: each tile carries an atomic "step" counter, and worker
threads in a single parallel region busy-scan the tile grid and
claim ready work via compare-and-swap. Ordering is enforced purely
through per-tile counters and acquire/release atomics (no locks,
no central queue).
-> Workers bias scanning toward the critical path (diagonal POTRF and
its panel TRSM) before falling back to trailing SYRK/GEMM updates,
with a per-thread rotation offset to reduce CAS contention.
-> Auto-tune thread count and block size per problem-size band.

AMD-Internal: CPUPL-8427
* Netlib test build failure with AOCC 6.0

AOCC 6.0+ ships the LLVM-based flang ("flang-new"), which no longer accepts the gfortran-style '-frecursive' option.
So use '-Mrecursive' instead of '-frecursive' inherited from make.inc.example. This change is applied unconditionally
for all AOCC versions, as older AOCC (Classic Flang) accepts it as well.

AMD-Internal: CPUPL-8423
Fix for build warning in ST build. 

CPUPL:8696
AOCL-LAPACK: DGESDD optimization

-> Optimized DGEBRD panel reduction for large sizes
-> Added threaded dlabrd variant (dlabrd_var1)
-> Parallelized all dgemv and dscal calls in dlabrd
-> Included cache aligned work distribution across threads
-> Added implementation for custom barrier synchronization among threads.
Fixed build-related issues, including LP64/MT warnings, unused variables, and general warning cleanup.
Improved pivot buffer handling by preventing integer overflows and zero-size allocations.
Standardized OpenMP support on Windows, including compile and test configurations.
Simplified and unified OpenMP test setup using automatic detection via find_package(OpenMP).
…cision overdetermined DGEBRD)

In the multithreaded upper-bidiagonal path of fla_dlabrd_var1, the
transpose GEMV that computes X(1:i-1,i) reads the Y panel and must use
the bidiagonal extent N-I as its row count. It was instead reusing the
M-I value left over from the preceding X(i+1:m,i) block. For
overdetermined inputs (m > n) this exceeded the Y panel's leading
dimension, tripping the GEMV LDA check (making the call a no-op) and
reading past valid data, which produced NaNs in the bidiagonal and
downstream accuracy failures. Set the row count to N-I to match the
serial path and reference LAPACK.
Fix DGETRF small-matrix perf regression by restoring split row-swap strides. Using distinct stride expressions stops GCC from collapsing the swap loop into a slow single-pointer scale-8 form, recovering ~7-10% on sizes 4-31.

AMD-Internal - CPUPL-8475
Added fixes for issues flagged in code static analysis.
All medium impact issues were resolved.
Following changes are added

- Added optimizations to DLARF1F and DLARF1L APIs from DLARF
- Added main tests for xLARF1F and xLARF1L
- Refactored mechanism to skip certain precision tests in main test suite.

AMD-Internal: CPUPL-8525
Extend DGEQRF optimizations to the remaining three precisions.
- Added a prefix-parameterized AVX2 small-GEQRF kernel to support s/d coexistence.
- Unified complex and double-complex implementations under shared logic.
Library version upgraded to 5.3.2
GCC latest versions lead to performance drop in SVD/Eigen APIs.
This was due to regression in code generation for a critical yet un-vectorized block in Givens rotation application.
Rewritten the code with x86 intrinsics to make it independent of compiler optimizations.

AMD Internal: CPUPL-8171, 8172, 8160, 8161, 8577, 8580
AOCL-LAPACK: Coverity fixes

AMD-Internal: cpupl-8543
Updated netlib test script to select fortran compiler settings based on environment set.

AMD-Internal : [CPUPL-8792]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.