|
cuDDL
|
One reference database replicated on explicitly chosen devices, searched all-to-all by all of them at once. More...
Public Types | |
| using | database_type = reference_database< K, BucketCount, Layout > |
| using | index_type = reference_index< K, BucketCount, Layout > |
Public Member Functions | |
| Result< void > | build_index (index_storage storage=index_storage::automatic) |
| Builds an index on every replica. | |
| Result< void > | load_index (std::filesystem::path const &path) |
Loads the index file at path onto every replica. | |
| template<typename OnTile > | |
| Result< void > | search_all_to_all (OnTile &&on_tile, replica_search split={}) |
Exhaustively searches every unique database-row pair in split.shard on all replicas. | |
| template<typename OnTile > | |
| Result< void > | search_all_to_all (OnTile &&on_tile, search_options options, replica_search split={}) |
Threshold search of every unique pair in split.shard: pairs with at least options.minimum_matches matches, through each replica's index when one is loaded. | |
| size_t | size () const noexcept |
| Number of replicas, one per device. | |
| std::vector< cuda::device_ref > | devices () const |
| The devices, in replica order. | |
| database_type const & | database () const noexcept |
| The database every replica holds, as uploaded to replica 0. | |
Static Public Member Functions | |
| static Result< replicated_database > | upload (reference_database_file const &file, std::span< cuda::device_ref const > devices) |
Uploads file to each of devices, concurrently. | |
| static Result< replicated_database > | adopt (std::vector< database_type > databases) |
| Adopts databases that already hold identical rows, one per device, each searched on the device that built it (reference_database::device). | |
One reference database replicated on explicitly chosen devices, searched all-to-all by all of them at once.
Each device gets a replica with its own stream, result storage, optional index, and pinned host memory on the device's host NUMA node, so downloads stay off the socket interconnect. A search runs one host thread per replica. Replicas claim tiles from one all_to_all_tile_queue, largest first, so devices of different speeds share the work: a faster device simply claims more. Kernels pick their launch shapes from each device's own properties, so the devices may differ in architecture and memory size; each needs room for the rows and its result storage, and a device without it fails the search with its error.
To split a search across processes, for example MPI ranks on several nodes, give each process its own group and pass every process a different all_to_all_shard. To let processes of different speeds share the work, also pass every process the same next_tile counter, such as a shared_tile_counter from distributed.cuh; there, cuddl::search_all_to_all sets both up from an MPI communicator.
Definition at line 72 of file replicated_database.cuh.
| using cuddl::replicated_database< K, BucketCount, Layout >::database_type = reference_database<K, BucketCount, Layout> |
Definition at line 74 of file replicated_database.cuh.
| using cuddl::replicated_database< K, BucketCount, Layout >::index_type = reference_index<K, BucketCount, Layout> |
Definition at line 75 of file replicated_database.cuh.
|
inlinestatic |
Adopts databases that already hold identical rows, one per device, each searched on the device that built it (reference_database::device).
The streams that built them must outlive the group.
Definition at line 91 of file replicated_database.cuh.
|
inline |
Builds an index on every replica.
Definition at line 107 of file replicated_database.cuh.
|
inlinenoexcept |
The database every replica holds, as uploaded to replica 0.
Definition at line 160 of file replicated_database.cuh.
|
inline |
The devices, in replica order.
Definition at line 153 of file replicated_database.cuh.
|
inline |
Loads the index file at path onto every replica.
Definition at line 116 of file replicated_database.cuh.
|
inline |
Exhaustively searches every unique database-row pair in split.shard on all replicas.
on_tile receives each tile as a replica_tile. By default replicas call it concurrently from their own threads, in no particular order, so it must be thread-safe; with split.in_query_order they call it one tile at a time in increasing query order. Like the single-database search, it must consume the tile before returning or enqueue dependent work on the tile's stream. An exception from on_tile stops every replica and is rethrown here.
Definition at line 135 of file replicated_database.cuh.
|
inline |
Threshold search of every unique pair in split.shard: pairs with at least options.minimum_matches matches, through each replica's index when one is loaded.
Definition at line 143 of file replicated_database.cuh.
|
inlinenoexcept |
Number of replicas, one per device.
Definition at line 148 of file replicated_database.cuh.
|
inlinestatic |
Uploads file to each of devices, concurrently.
Definition at line 79 of file replicated_database.cuh.