Repository navigation
Mixed-precision corrections, src reorganisation, tests, docs and benchmarks - #23
Open
AkhilAkkapelli wants to merge 16 commits into
Open
AkhilAkkapelli wants to merge 16 commits into
AkhilAkkapelli wants to merge 16 commits into
Conversation
Corrections on top of #22, agreed change by change: BFloat16, helper names, then the mixed-precision corrections. BFloat16 - BFloat16s.jl is a dependency and its BFloat16 replaces the _BFloat16 constant in src, ext and tests, so BFloat16 blocks and GEMM work on Julia 1.10 as well as 1.11. Names - _supported -> _is_block_precision, _check_args -> _check_mixedprec_args. - Block helpers renamed: _quantize_mixedprec_block, _requantize_mixedprec_offdiag_block!, _update_mixedprec_offdiag_block!, _solve_mixedprec_offdiag_block!, _triangular_mixedprec. No comments in blocks.jl. Scales and leaves - Scale factors are always Float32: scale_type and T_Scale are removed from the four containers and adaptive_precisions, and quantize is quantize(A, T=Float16) -> (Q, s). - precisions[end] must be Float32 or Float64. - A scale is only raised when an update or solve outgrows it; a scale past floatmax(Float32) throws ArgumentError instead of leaving the block Inf. Fixes - unified_rectrxm! with a SymmMixedPrec and trans = 'T' used the stored triangle untransposed (2-10% error, or DimensionMismatch). - unified_rectrxm! throws when uplo is not A.uplo for a SymmMixedPrec or TriMixedPrec instead of giving a wrong result. - recgemm! takes one product over the whole k per quadrant, so sizes that are not a power of two work in recgemm! and lu_recursive!. - adaptive_precisions takes 16- and 8-bit block norms in Float64, so finite BFloat16 matrices with very large or very small entries are accepted. - typemin of a signed integer matrix is scaled instead of stored as -Inf. - A' on a container gives a TransposedMixedPrec. Cleanups - No clamp when quantizing; the block max is taken without a temporary. - adaptive_precisions gives Float32 leaves to a Float32 matrix and reads A once; the adaptive_precision_LT, lu_recursive_mixed! and unified_rec_mixed names are removed. - MixedPrecision re-exports the five routines it extends. - Seven single-caller _ helpers are folded into their callers; lu_recursive! and recgemm! recurse into themselves. - src/recursion.jl and src/backend_traits.jl are folded into src/NextLA.jl. - Docstrings match the code; tests cover every fix above.
…le; fixes for nightly, larfb! aliasing and the mixed-precision containers on the GPU Co-authored-by: Alessandro <axelcar482@gmail.com>
…r src/, --backends option, tests for the mixed-precision containers and TLR
…ed precision, tile low-rank, benchmarks), API reference organised like src/, CONTRIBUTING, CITATION; move the poster and handout to docs/src/assets
Code (src/, ext/):
- Fixes found by the test and benchmark work (runs T127-T146): flags accepted in either case
and checked in trsm!/trmm!/unified_rectrxm!; PosDefException from cholesky_lower! and
cholesky_blocked!; info counted in the whole matrix for the recursive LU and Cholesky;
empty inputs return at once; Float16 sums in Float32 (SYRK kernel, QR norms); CUDA views
with non-consecutive rows and mixed-size vector batches; cuBLAS at the CUDA leaves of the
triangular solve and multiply, and for larfb!/unmqr! in Float32; concurrent tasks in the
mixed-precision recursions; transposed containers refused with a clear error.
- Docstrings checked against the code and corrected.
- The tile low-rank (TLR) module is removed; it will come back in its own PR.
Tests (test/): new and reorganised tests, shared helpers in test/setup/, options to choose
cases inside the tests (--types, --uplo, --n, ...), --failfast, --gpu-debug, --no-float64.
CI also runs the current Julia release.
Docs: a Dense matrices manual page, the Benchmarks page redone from the final GPU runs
(speed, accuracy, adaptive_precisions, the Euro-Par 2026 experiments), the WHPC/ISC 2026
poster on the home page, and "Running the benchmarks".
benchmark/: run.jl reproduces the Benchmarks page for gemm, syrk, trsm, trmm, potrf and lu
against the vendor libraries (CPU or CUDA):
julia --project=benchmark benchmark/run.jl gemm potrf --backends=CUDA
…HPC/ISC 2026 poster The Float64 points at n = 32768 (and Cholesky at 65536) are run without time caps; the comparison uses the poster's numbers against the vendor Float64 routines; formulas in LaTeX.
Same behaviour, easier to read: run.jl reads the command line; routines.jl has the six routines, their test matrices and what each line calls; harness.jl measures the points and writes the results. Checked on the CPU and with CUDA: the same points and fields as the single-file version.
The full suite with coverage ran past 60 minutes on the Julia 1 runner and was cancelled; 1.10 and nightly finished in time. Test sizes are unchanged.
…timeout, benchmark timing, docs - Float16 x Float16 products on Metal and oneAPI form the sum in Float32 instead of failing (B50); recgemm! keeps wider operands wide where gemmEx! is refused (T51). - uplo flags in either case (C18); parfb! with m2 = 0, CUDA potrf_batched! returns (A, info), ttqrt!/ttmqr! read only the upper triangle; TriMixedPrec(::SymmMixedPrec) docstring. - CI: coverage off for Julia 1, test timeout 60 minutes. - benchmark/: the timer waits for every GPU stream; README timing rule and one device per run. - Docs: Backends, dense and mixed-precision pages follow the fixes.
…(pf5, pf6a) - recsyrk! into a SymmMixedPrec: a Float64 leaf updated by Float16 or Float32 rows takes the product in Float32 and adds it into the leaf in Float64 (pf5). - A faster SymmMixedPrec/TriMixedPrec container build (pf6a). - Tests for both; the Mixed precision page describes the Float64-leaf update.
…paper [3]'s code; pf5 accuracy note, README bound 1e-6 - Benchmarks page rewritten: mixed-precision Cholesky, SYRK and TRSM against paper [3]'s own code and the vendor libraries at n = 65536, GEMM and LU against the same code, papers [1] and [2], the GB10 Float16 : Float32 ceiling, and how it was measured. Eight new charts (Markdown images, so their paths work with pretty URLs); the old charts are removed. Some points are still being rerun, as the page says. - pf5's Float32 sums for a Float64 leaf's update cost accuracy when only Float32 blocks feed the leaf: the Mixed precision page and the source comment say so, and the README's [Float32, Float64] example checks < 1e-6 (measured up to 1.9e-7).
… the vendor libraries only
AkhilAkkapelli
temporarily deployed
to
github-pages
November 30, 2026 23:16 — with
GitHub Pages
Inactive
…as the other branches - TRSM/TRMM on CUDA recurse instead of one whole-call cuBLAS solve; smallest TRMM block 16; Float32/Float64 updates via Sgemm/Dgemm. - Cholesky's Float32/Float64 panel solves use trsm!, which on CUDA is one cuBLAS call. - Dense Float64 GEMM on CUDA via Dgemm. - Dense SYRK runs its halves in parallel when n > 4096; mixed-type SYRK/GEMM is computed in the wider type. - Mixed SYRK smallest block 4096; TF32 off in mixed GEMM (mixed LU keeps TF32). Float16 GEMM/LU keep Float32 sums.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR started as the mixed-precision corrections on top of #22 (first commit). It now also
carries the work that was in #24 (closed), plus the fixes and tests that followed. There are five
commits, each reviewable on its own:
mxp: Float32 scales, fixes for wrong results and crashes, and cleanupsReorganise src into dense/, mxp/ and tlr/ …src/laid out like BLAS/LAPACKTests: one environment with ParallelTestRunner …src/Docs: README as the home page …Final source: fixes and tests, TLR removed, docs and a benchmark runnerThe last commit
Fixes, found while testing and benchmarking:
trsm!,trmm!andunified_rectrxm!;PosDefExceptionfromcholesky_lower!andcholesky_blocked!;infocounted in the whole matrix for the recursive LU and Cholesky;Float16sums inFloat32(SYRK kernel, QR norms);larfb!/unmqr!inFloat32;Docstrings were checked against the code and corrected.
TLR removed. The tile low-rank module is taken out of this PR; it will come back in its own.
Tests:
test/setup/;--types,--uplo,--n, …), plus--failfast,--gpu-debugand--no-float64;Docs: a Dense matrices page, the Benchmarks page redone from final GPU runs, the WHPC/ISC 2026
poster on the home page, and "Running the benchmarks".
benchmark/:run.jlreproduces the Benchmarks page against the vendor libraries, on the CPUor CUDA:
Performance
NVIDIA GB10, Julia 1.10.14: final runs against the runs of 2026-11-24. The vendor libraries ran
at the same speed in both (median 1.00–1.05×), so the differences come from NextLA.
Float32recsyrk!, n = 16384)Testing
The full suite on the final tree, on the CPU and with CUDA (NVIDIA GB10), passes on:
@test_broken)The docs build passes with every doctest.