|
cuDDL
|
Batch operations over contiguous device rows. More...
Namespaces | |
| namespace | a48 |
| namespace | detail |
Classes | |
| struct | all_to_all_shard |
| Part cuDDL of count disjoint parts of an all-to-all search. More... | |
| class | all_to_all_tile_queue |
| Thread-safe source of the all-to-all tiles one process searches. More... | |
| struct | batch_result_tile |
| Non-owning view of one batch-search tile's results. More... | |
| struct | batch_search_requirements |
| Caller-owned storage requirements for one bounded query tile. More... | |
| struct | batch_search_result |
| Stable query/reference IDs and their exact query-relative bucket comparison counts. More... | |
| struct | CudaError |
| CUDA failure payload: status code, call site, and formatted message. More... | |
| class | device_blacklist |
| Reusable, move-only device lookup. More... | |
| struct | device_span |
| A span that is assumed to point to device-accessible memory. More... | |
| struct | Error |
| Error payload carried in Result on failure. More... | |
| struct | genome_slice |
| One rank's share of a genome collection split across an MPI communicator. More... | |
| class | host_batch_results |
| Host copy of a batch_result_tile holding only the passing results, packed in query-major, reference order, in pinned memory; tile views it. More... | |
| struct | hybrid_cardinality_estimates |
| Experimental DDL cardinality estimates computed from one register scan. More... | |
| struct | InvalidArgumentError |
| Invalid-argument failure payload. More... | |
| class | kmer_blacklist |
| Immutable canonical k-mers excluded from construction, independent of sketch size. More... | |
| struct | packed_pairwise_counts |
| One pair's exact bucket comparison counts in 64 bits, the storage and transfer form of batch-search results. More... | |
| struct | pairwise_counts |
| Raw per-bucket classification counts for one sketch pair comparison. More... | |
| struct | pairwise_summary |
| Pairwise counts with an optional compile-time cardinality field. More... | |
| struct | path_build_options |
| Knobs for a build the caller feeds with FASTA/FASTQ paths. More... | |
| class | query_sketch_batch |
| Query sketches held on the device, in the shape a search consumes them. More... | |
| struct | reference_build_statistics |
| How a build moved sequence bytes to the device. More... | |
| class | reference_database |
| Move-only owner of one immutable contiguous reference database. More... | |
| class | reference_database_file |
| Host-owned reference sketches and labels, ready for binary storage or GPU upload. More... | |
| struct | reference_database_metadata |
| Recorded metadata for an immutable reference database. More... | |
| class | reference_index |
| Move-only acceleration data for an immutable reference database. More... | |
| class | reference_index_file |
| Index-file persistence and the validation boundary for reference_index. More... | |
| struct | reference_search_result |
| Stable reference ID and exact query-relative bucket comparison counts. More... | |
| struct | register_layout |
| Compile-time split of a 16-bit DDL score into exponent and mantissa fields. More... | |
| struct | replica_search |
| How a replicated_database search splits and delivers its tiles. More... | |
| struct | replica_tile |
| One all-to-all tile as a replicated_database search delivers it. More... | |
| class | replicated_database |
| One reference database replicated on explicitly chosen devices, searched all-to-all by all of them at once. More... | |
| struct | ResourceError |
| Resource failure payload: allocation, I/O, or capacity errors. More... | |
| struct | Result |
Fallible API result: cuda::std::expected<T, Error> with cuDDL factories. More... | |
| struct | Result< void > |
| class | result_file |
| Writes search results to files while the GPUs search on. More... | |
| struct | result_file_options |
| struct | result_file_statistics |
| What a result_file wrote and how long its callers waited for it. More... | |
| struct | score_compatibility |
| Construction parameters of compatible score rows. More... | |
| struct | search_options |
| Matching-bucket threshold, independent of whether an index accelerates the search. More... | |
| struct | sequence_build_options |
| Knobs for a build the caller feeds with bases it already holds. More... | |
| class | shared_tile_counter |
| A tile counter shared by every rank of a communicator, for replica_search::next_tile. More... | |
| struct | similarity_record |
| One pair of a thresholded search in result_format::similarity. More... | |
| class | sketch |
| Move-only owning DDL sketch backed by one contiguous device allocation. More... | |
| struct | SourceLocation |
| File, line, and column for a C++ call site or FASTX input position. More... | |
| class | top_k_search |
Keeps each genome's k most similar genomes from search tiles on the device. More... | |
Typedefs | |
| using | default_register_layout = register_layout< 6, 10 > |
| using | fasta_parse_result = detail::fasta_parse_result |
| Result of parsing one FASTA/FASTQ file into packed canonical k-mers. | |
| using | transfer_mode = detail::transfer_mode |
| How a build gets its sequence bytes to the device. | |
| using | decompression_backend = detail::decompression_backend |
| Selects decompression independently of host transfers. | |
| using | sequence_record = detail::sequence_record |
| One record of a genome the caller already holds: bases only. | |
| using | sequence_genome = detail::sequence_genome |
| One genome as its records, in order. No records keeps the genome's ID with a zero row. | |
Enumerations | |
| enum class | ErrorCategory : uint8_t { cuda , invalid_argument , resource } |
| Error category for Result failures. More... | |
| enum class | index_storage { automatic , dense , sparse } |
| Dense offsets favor query latency; sparse sorted keys reduce index memory and build time. More... | |
| enum class | result_format : uint8_t { counts , similarity } |
| How a result_file stores each pair. More... | |
Functions | |
| template<size_t BucketCount> | |
| Result< void > | compare_batch_async (device_span< uint32_t const > left_rows, device_span< uint32_t const > right_rows, device_span< pairwise_summary > outputs, cuda::stream_ref stream) |
| Compares corresponding rows from two contiguous register batches. | |
| template<size_t BucketCount, typename Layout = default_register_layout> | |
| Result< void > | cardinality_batch_async (device_span< uint32_t const > sketches, device_span< uint64_t > empty_out, device_span< double > estimates_out, cuda::stream_ref stream) |
| Computes the cardinality of every stored sketch. | |
| template<size_t BucketCount> | |
| Result< void > | extract_scores_batch_async (device_span< uint32_t const > sketches, device_span< uint16_t > scores_out, cuda::stream_ref stream) |
| Copies the winning score of every register into compact row-major scores. | |
| Result< genome_slice > | slice_genomes (std::filesystem::path const &input, MPI_Comm comm, unsigned workers=default_parser_workers()) |
Lists a genome collection once and splits it into one contiguous slice per rank of comm, of about equal file bytes. | |
| Result< reference_database_file > | gather_sketches (reference_database_file const &mine, genome_slice const &slice, MPI_Comm comm) |
| Gathers every rank's sketches of its genome_slice into one file on every rank. | |
| template<uint32_t K, size_t BucketCount, typename Layout , typename OnTile > | |
| Result< void > | search_all_to_all (replicated_database< K, BucketCount, Layout > &group, OnTile &&on_tile, MPI_Comm comm) |
Compares every pair of group's references, sharing the tiles among the ranks of comm; collective. | |
| template<uint32_t K, size_t BucketCount, typename Layout , typename OnTile > | |
| Result< void > | search_all_to_all (replicated_database< K, BucketCount, Layout > &group, OnTile &&on_tile, search_options options, MPI_Comm comm) |
The threshold form of search_all_to_all: only pairs passing options reach on_tile. | |
| void | cuda_abort_on_error (cudaError_t error, std::source_location location=std::source_location::current()) |
Terminates the process when error is not cudaSuccess (for RAII teardown only). | |
| cuda::std::unexpected< Error > | Err (Error error) |
Failure return; converts to any Result<T> via cuda::std::unexpected. | |
| Result< void > | Ok () noexcept |
Success return for Result<void>; same as return {}. | |
| Result< void > | cuda_try (cudaError_t error, std::source_location location=std::source_location::current()) |
| Checks a CUDA runtime call and returns an error on failure. | |
| template<std::invocable Operation> | |
| auto | cuda_try (Operation &&operation, std::source_location location=std::source_location::current()) |
| Converts CCCL exceptions to the same Result errors as CUDA status-returning APIs. | |
| Result< fasta_parse_result > | parse_fasta_file (std::string const &path, uint32_t k, unsigned threads=std::thread::hardware_concurrency()) |
Parses a FASTA/FASTQ file's sequence bases into packed canonical k-mers of length k. | |
| __host__ __device__ constexpr float | weighted_kmer_identity (pairwise_counts const &counts) noexcept |
Weighted k-mer identity of a pair, equal / max(equal + min(lower, higher), 6), as sketch::wkid computes it, or 0 when no bucket is comparable. | |
| Result< void > | download (batch_result_tile const &tile, cuda::stream_ref stream, host_batch_results &host) |
Copies a device tile's passing results into host's pinned buffers, growing them only when needed, and synchronizes stream. | |
| Result< host_batch_results > | download (batch_result_tile const &tile, cuda::stream_ref stream) |
| Copies a device tile's passing results to new pinned host memory; see the overload that downloads into reusable host_batch_results. | |
| template<typename F > | |
| Result< void > | for_each_passing (batch_result_tile const &tile, cuda::stream_ref stream, F &&f) |
Calls f on the host with every passing result of a device tile, query-major and in reference order; synchronizes stream. | |
| unsigned | default_parser_workers () |
| Loaders a path build runs unless the caller asks for another count. | |
| Result< std::vector< std::filesystem::path > > | genome_paths (std::filesystem::path const &directory) |
The FASTA/FASTQ files under directory, searched recursively and sorted by path, which is the order that numbers reference IDs. | |
| Result< std::vector< std::filesystem::path > > | list_genomes (std::filesystem::path const &input) |
| Paths from a directory (see genome_paths) or from a text file with one path per line, in the file's order. | |
| template<uint32_t K, size_t BucketCount, typename Layout = default_register_layout> | |
| Result< cuda::device_buffer< uint32_t > > | build_sketch_store (std::span< std::filesystem::path const > paths, cuda::stream_ref stream, path_build_options options={}) |
| Sketches one genome per plain or gzip/BGZF FASTA/FASTQ file into a device store. | |
| score_compatibility | decoded_compatibility (uint8_t k, uint16_t buckets, uint8_t exponent_bits, uint64_t seed) |
| Builds a cuDDL score-compatibility object describing a decoded BBTools A48 database. | |
| std::vector< batch_search_result > | select_top_k (std::vector< batch_search_result > rows, uint32_t k) |
The k best rows of each query among rows, as top_k_search ranks them, best first and query by query. | |
Batch operations over contiguous device rows.
Every function takes flat row-major spans of BucketCount uint32_t registers per sketch, the layout of a single sketch allocation and of the stores the file builders write, and runs the whole batch in one kernel launch, so a collection of N rows costs one launch instead of N.
Inputs and outputs must remain valid until stream completes.
| using cuddl::decompression_backend = typedef detail::decompression_backend |
Selects decompression independently of host transfers.
Definition at line 155 of file reference_database_file.cuh.
| using cuddl::default_register_layout = typedef register_layout<6, 10> |
Definition at line 22 of file register.cuh.
| using cuddl::fasta_parse_result = typedef detail::fasta_parse_result |
| using cuddl::sequence_genome = typedef detail::sequence_genome |
One genome as its records, in order. No records keeps the genome's ID with a zero row.
Definition at line 161 of file reference_database_file.cuh.
| using cuddl::sequence_record = typedef detail::sequence_record |
One record of a genome the caller already holds: bases only.
Definition at line 158 of file reference_database_file.cuh.
| using cuddl::transfer_mode = typedef detail::transfer_mode |
How a build gets its sequence bytes to the device.
Definition at line 152 of file reference_database_file.cuh.
|
strong |
|
strong |
Dense offsets favor query latency; sparse sorted keys reduce index memory and build time.
Automatic picks whichever needs fewer device bytes for the database's reference count.
| Enumerator | |
|---|---|
| automatic | |
| dense | |
| sparse | |
Definition at line 60 of file reference_database.cuh.
|
strong |
How a result_file stores each pair.
| Enumerator | |
|---|---|
| counts | One 24-byte batch_search_result per pair: query ID, reference ID and the lower, equal, higher and both-empty bucket counts, six little-endian |
| similarity | The pair's weighted_kmer_identity as a 4-byte float, computed on the GPU. A tile that holds every pair is written as its first query ID and query count (two |
Definition at line 35 of file result_file.cuh.
| Result< cuda::device_buffer< uint32_t > > cuddl::build_sketch_store | ( | std::span< std::filesystem::path const > | paths, |
| cuda::stream_ref | stream, | ||
| path_build_options | options = {} |
||
| ) |
Sketches one genome per plain or gzip/BGZF FASTA/FASTQ file into a device store.
Each genome gets BucketCount registers, the row layout the batch operations in batch.cuh consume, in the order of paths. The rows never leave the device. The build is synchronous.
Definition at line 685 of file reference_database_file.cuh.
|
inline |
Computes the cardinality of every stored sketch.
empty_out receives the empty-register count per row and estimates_out the cardinality estimate per row.
Definition at line 80 of file batch.cuh.
| Result< void > cuddl::compare_batch_async | ( | device_span< uint32_t const > | left_rows, |
| device_span< uint32_t const > | right_rows, | ||
| device_span< pairwise_summary > | outputs, | ||
| cuda::stream_ref | stream | ||
| ) |
Compares corresponding rows from two contiguous register batches.
The input spans are row-major and must contain the same whole number of BucketCount rows. outputs must hold at least one summary per row pair. Inputs and outputs must remain valid until stream completes. The whole batch runs in one kernel launch.
Definition at line 35 of file batch.cuh.
|
inline |
Terminates the process when error is not cudaSuccess (for RAII teardown only).
Definition at line 144 of file error.hpp.
|
inline |
| auto cuddl::cuda_try | ( | Operation && | operation, |
| std::source_location | location = std::source_location::current() |
||
| ) |
Converts CCCL exceptions to the same Result errors as CUDA status-returning APIs.
Definition at line 197 of file error.hpp.
|
inline |
Builds a cuDDL score-compatibility object describing a decoded BBTools A48 database.
Decoded rows come from the BBTools encoder/hash pipeline, not the cuDDL one. The encoder and hash identity fields therefore carry nonzero sentinels (2) distinct from cuDDL's own construction constants, while the mantissa/exponent split and bucket/key masks are taken from the asset's header so decoded rows pass cuDDL's normal validation paths.
Definition at line 15 of file refseq_parity.hpp.
|
inline |
Loaders a path build runs unless the caller asks for another count.
Machine thread count, falling back to 8 when the count is unavailable.
Definition at line 166 of file reference_database_file.cuh.
|
inline |
Copies a device tile's passing results to new pinned host memory; see the overload that downloads into reusable host_batch_results.
Definition at line 583 of file reference_database.cuh.
|
inline |
Copies a device tile's passing results into host's pinned buffers, growing them only when needed, and synchronizes stream.
Exhaustive tiles are copied as they are, since every slot passes in order. Threshold tiles are packed on the device: a scan of the pass-bit words gives each word's first packed position, and a gather writes the passing records straight into the host buffer.
Definition at line 427 of file reference_database.cuh.
|
inline |
Copies the winning score of every register into compact row-major scores.
scores_out holds one uint16_t-per-register row per stored sketch.
Definition at line 123 of file batch.cuh.
| Result< void > cuddl::for_each_passing | ( | batch_result_tile const & | tile, |
| cuda::stream_ref | stream, | ||
| F && | f | ||
| ) |
Calls f on the host with every passing result of a device tile, query-major and in reference order; synchronizes stream.
Results cross the bus in chunks through two pinned buffers, so the copy of chunk k + 1 runs while f visits chunk k. Threshold tiles are packed on the device first, so only passing results are copied. This streams where download materializes the whole tile.
Definition at line 615 of file reference_database.cuh.
|
inline |
Gathers every rank's sketches of its genome_slice into one file on every rank.
Collective.
mine must hold the sketches of slice.mine(), in order, and every rank must have built with the same k, buckets, layout and blacklist; both are checked. The result equals a single-process build of slice.paths: rows in reference-ID order, labelled with the paths. Rows travel over MPI from host memory; every rank receives all of them.
Definition at line 285 of file distributed.cuh.
|
inline |
The FASTA/FASTQ files under directory, searched recursively and sorted by path, which is the order that numbers reference IDs.
Recognised extensions are .fa, .fna, .fasta, .ffn, .frn, .fq and .fastq, in any case, optionally followed by .gz, .bgz or .bgzf. Entries are filtered by the type the directory reports and symlinks are kept without being followed, so listing a directory of symlinked genomes costs no per-file metadata lookup.
Definition at line 214 of file reference_database_file.cuh.
|
inline |
Paths from a directory (see genome_paths) or from a text file with one path per line, in the file's order.
Definition at line 244 of file reference_database_file.cuh.
|
inlinenoexcept |
Success return for Result<void>; same as return {}.
Definition at line 181 of file error.hpp.
|
inline |
Parses a FASTA/FASTQ file's sequence bases into packed canonical k-mers of length k.
Gzip/BGZF is detected by magic bytes and decompressed before parsing. Format is detected from the first record header; FASTQ qualities are validated and ignored. This is the FASTX entry point. It reads every record as one combined genome and emits a packed canonical k-mer per contiguous run of k valid bases; an invalid or ambiguous base breaks the rolling window, and no k-mer spanning it is emitted. Record boundaries also reset the window, without contributing to invalid_windows. See detail::parse_fasta.
| path | FASTA/FASTQ file to parse. |
| k | K-mer length. |
| threads | Worker count for parallel files, defaulting to std::thread::hardware_concurrency(); files at or below 1 MiB parse serially. |
Definition at line 34 of file fastx.hpp.
| Result< void > cuddl::search_all_to_all | ( | replicated_database< K, BucketCount, Layout > & | group, |
| OnTile && | on_tile, | ||
| MPI_Comm | comm | ||
| ) |
Compares every pair of group's references, sharing the tiles among the ranks of comm; collective.
Every rank calls it with a replicated_database of the same rows. Each rank delivers the tiles it claims to on_tile, as replicated_database::search_all_to_all does, and every pair is delivered on exactly one rank. The ranks share one shared_tile_counter for the call.
Definition at line 475 of file distributed.cuh.
| Result< void > cuddl::search_all_to_all | ( | replicated_database< K, BucketCount, Layout > & | group, |
| OnTile && | on_tile, | ||
| search_options | options, | ||
| MPI_Comm | comm | ||
| ) |
The threshold form of search_all_to_all: only pairs passing options reach on_tile.
group needs its index (replicated_database::build_index); collective.
Definition at line 488 of file distributed.cuh.
|
inline |
The k best rows of each query among rows, as top_k_search ranks them, best first and query by query.
Merges the downloads of collectors that saw disjoint tiles.
Definition at line 533 of file top_k.cuh.
|
inline |
Lists a genome collection once and splits it into one contiguous slice per rank of comm, of about equal file bytes.
Collective.
Rank 0 lists input, a directory (see genome_paths) or a text file with one path per line, and shares the list. Every rank then looks up the sizes of an equal share of the files with workers threads, because on a parallel file system each lookup waits for a metadata round trip, and the ranks exchange them. Slices follow path order, so concatenating them in rank order gives the reference IDs of a single-process build. Bytes stand in for sketching work; a rank may get no genomes when there are fewer genomes than ranks.
Definition at line 159 of file distributed.cuh.
|
constexprnoexcept |
Weighted k-mer identity of a pair, equal / max(equal + min(lower, higher), 6), as sketch::wkid computes it, or 0 when no bucket is comparable.
The divisor's floor of six suppresses similarity from sparse random collisions.
Definition at line 83 of file pairwise_counts.cuh.