Repository navigation
Sparse UDLF backend (replaces UDLF-CSR) - #14
Merged
Merged
Conversation
Sparse UDLF (https://github.com/andreTomi/Sparse_UDLF) replaces UDLF-CSR: sparse CPRR, LHRR, RDPAC, RFE and BFSTree. The script clones it at a pinned commit (de3c14c) and builds both of its binaries: bin/udlf (fast-math, CPRR and LHRR) and bin/udlf_strict (every method; RDPAC, RFE and BFSTree refuse to run in the fast-math binary). Without libjemalloc-dev it links against the jemalloc runtime library directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runs Sparse UDLF (commit de3c14c) directly on configs written by hand and records what pyUDLF will rely on: - CPRR_SPARSE, LHRR_SPARSE, RDPAC and BFSTree give ranked lists byte-identical to UDLF 1.70 on the synthetic dataset, independent of the number of threads; CPRR and LHRR agree between both binaries; - the fast-math binary refuses RDPAC, RFE and BFSTree; - RFE cannot run: its PERFORM_CCS, RERANK_BY_EMB and EXPORT_EMBEDDINGS parameters are commented out in Validator.hpp, so the parser drops them (strict xfail, so the test flags when this is fixed); - OUTPUT_FILE_PATH is the output file itself, with a copy always written to output/reranked_lists.txt; lines have exactly L ids; - absent keys take defaults, unknown keys are reported on stderr, errors exit with code 1, UDLF_TMPDIR sets the scratch directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UDLF(backend="sparse") runs Sparse UDLF (https://github.com/andreTomi/Sparse_UDLF, commit de3c14c), the successor of UDLF-CSR: sparse CPRR, LHRR, RDPAC, RFE and BFSTREE. On the synthetic dataset its ranked lists are byte-identical to UDLF 1.70, and the tests now compare the two backends directly. - bin_path (or UDLF_SPARSE_BIN) is the directory of its two binaries or one of them; each method runs in the right one (RDPAC, RFE and BFSTREE need udlf_strict). Methods take UDLF or Sparse UDLF names (BFSTREE / BFSTree). - Parameters keep the UDLF 1.70 defaults and schema; Sparse UDLF adds threads (LHRR, defaults to UDLF(threads=)), b and memory_budget_mb (BFSTREE). RFE runs without connected components (not ported yet), with a warning. - Each run gets its own UDLF_TMPDIR inside the run directory, so simultaneous runs do not share scratch files. - The log parser no longer reads the "RELATIVE GAINS" block as measures. - In de3c14c RFE cannot run (its flags are commented out in Validator.hpp) and the matrix output is all zeros: the RFE error explains it, output="matrix" is refused, and run_config warns about an all-zero matrix. - Removed with UDLF-CSR: engine=, the dense/MKL/BLAS/Eigen engines, the retry of its intermittent startup error (0 failures in 300 Sparse UDLF runs) and scripts/build_csr.sh. backend="csr" and UDLF_CSR_BIN remain as aliases; a UDLF-CSR binary is detected and rejected with a pointer to build_sparse.sh. - examples/csr_engines.py becomes examples/sparse_methods.py; CI builds Sparse UDLF (libtbb-dev, libjemalloc-dev). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unreleased 0.9.0 entry now describes the Sparse UDLF backend instead of UDLF-CSR, and the open questions list the Sparse UDLF (de3c14c) issues to report upstream: RFE cannot run, perform_ccs is not ported, the matrix output is all zeros, the fixed output/reranked_lists.txt copy, and the build needs (jemalloc, make test-* directories). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test_former_udlf_csr_is_rejected fakes the binary with a shell script, which Windows cannot run: skipped there. - ubuntu-latest moved to Ubuntu 26.04 (19/10/2026), which has no Python 3.9: the 3.9 job runs on ubuntu-24.04. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sparse UDLF is the successor of UDLF-CSR: sparse implementations of CPRR,
LHRR, RDPAC, RFE and BFSTREE for datasets where the dense N x N matrices of UDLF do not fit in memory. This PR makes
it the second backend of pyUDLF, in place of UDLF-CSR:
On the synthetic dataset, CPRR, LHRR, RDPAC and BFSTREE give ranked lists byte-identical to UDLF 1.70, so the
tests now compare the two backends directly.
Changes
scripts/build_sparse.sh: clones Sparse UDLF at a pinned commit (de3c14c) and builds both of its binaries:udlf(fast-math): CPRR and LHRR;udlf_strict: every method.bin_path/UDLF_SPARSE_BINis the directory of the binaries (or one of them). Each method runs in the binarythat supports it.
Methods accept UDLF or Sparse UDLF names (
BFSTREE/BFSTree,CPRR/CPRR_SPARSE).Parameters keep the UDLF 1.70 defaults and validation. Sparse UDLF adds:
threadsfor LHRR (defaults toUDLF(threads=));bandmemory_budget_mbfor BFSTREE.Each run gets its own
UDLF_TMPDIR, so simultaneous runs do not share scratch files.Fixed: the log parser read the "RELATIVE GAINS" block as measures.
Removed with UDLF-CSR:
engine=and the dense/MKL/BLAS/Eigen engines;scripts/build_csr.sh.backend="csr"andUDLF_CSR_BINstay as aliases. A UDLF-CSR binary is detected and rejected with a pointerto the build script.
examples/csr_engines.py→examples/sparse_methods.py. Updated the README (EN/PT), the examples table andthe CHANGELOG.
CI builds Sparse UDLF (
libtbb-dev,libjemalloc-dev).Known issues of Sparse UDLF
de3c14c(reported upstream)PERFORM_CCS,RERANK_BY_EMBandEXPORT_EMBEDDINGSparameters are commented out inValidator.hpp, so the config parser drops them. The error message explains it, and a strict-xfail test flagswhen it is fixed. RFE with
perform_ccs=Trueis not ported yet, so pyUDLF runs RFE without connected componentsand warns.
output="matrix"is refused, andrun_configwarns.Tests
de3c14c).tests/test_sparse_binary.py: the binaries run directly, without the wrapper;tests/test_sparse.py: the backend.