ABRIK Wrap-Up#130
Open
mmelnich wants to merge 19 commits into
Open
Conversation
124f1a7 to
5888ab1
Compare
ABRIK_speed_comparisons.cc and ABRIK_accuracy_analysis.cc both gain a num_runs
positional argument and an outer loop over runs that uses RNGState<RNG>(run) so
each run draws from a distinct seed. CSVs gain a leading 'run' column tagging
each data row with its run index. GESDD (deterministic) runs once and is
reported under run=0 in both benchmarks.
Speed_comparisons CLI: <prec> <outdir> <input> <target_rank> <run_gesdd>
<budget> <num_runs> <num_b_sz> <b_sz...> [sub_ratio] [use_cqrrt]
Accuracy_analysis CLI: <prec> <outdir> <input> <m> <n> <b_sz> <num_matmuls> <num_runs>
Previously the accuracy benchmark used RandLAPACK::gen::mat_gen with custom_input, which only handles whitespace-delimited text files. Feeding it the .bin matrices produced by gen_mat_alg971_paper crashed at the dimension query because the binary header was interpreted as ASCII rows. Switch to BenchIO::load_matrix (the same auto-detecting loader used by ABRIK_speed_comparisons and ABRIK_runtime_breakdown). It dispatches on file extension: .bin via read_bin_matrix, .txt via read_txt_matrix, .mtx via fast_matrix_market. Sparse input is now rejected explicitly with a clear error since accuracy_analysis runs a full GESDD. A is now owned by the LoadedMatrix and freed automatically; removed the matching new T[m*n] and delete[] A. CMakeLists.txt bumps the target's LINK_LIBS from Benchmark_libs to Benchmark_libs_external because ext_matrix_io.hh pulls in fast_matrix_market and Eigen headers, matching the other two ABRIK benchmark targets.
The summary `end_cols = iter * k / 2` truncates when iter*k is odd, which only
happens for odd block size k. For k=1, calling BK::call with max_krylov_iters=1
finishes the prelude + one odd half-step (Y_od[:,0:1] populated, R[0:1,0:1]
populated) but then returns end_cols=0 due to integer floor.
ABRIK::call_with_checkpoints then sees end_cols==0, emits the placeholder row
(total_matvecs=0, err=1), and breaks the entire checkpoint loop. Every
subsequent checkpoint (mv=2, 4, ..., 4096) is skipped, so the speed-comparison
CSVs contain only one sentinel row per run at b_sz=1.
The runtime-breakdown benchmark drives BK::call with fixed max_krylov_iters
>= 2 in every cell, so this path produced valid data — only call_with_checkpoints
at its first b_sz=1 checkpoint exposed the bug.
Fix: ceiling division `(iter * k + 1) / 2`. Bit-identical for even k (all
historical b_sz ∈ {4, 8, 16, 32, 64, 128} cases), and yields the correct
column count for odd k:
iter | k=1 floor | k=1 ceil | k=2 (no change) | k=4 (no change)
---- | --------- | -------- | --------------- | ---------------
1 | 0 (bug) | 1 | 1 | 2
2 | 1 | 1 | 2 | 4
3 | 1 (bug) | 2 | 3 | 6
4 | 2 | 2 | 4 | 8
No new tests added; the b_sz=1 path is now exercised by the existing
ABRIK_speed_comparisons benchmark at the bench level once Bergamo/SPR
campaigns rerun with this fix.
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.
WIP