cuDDL
Loading...
Searching...
No Matches
ablation.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <string_view>
5
6#if CUDDL_ABLATIONS
7 #include <algorithm>
8 #include <cstdio>
9 #include <cstdlib>
10#endif
11
12namespace cuddl::detail {
13
19inline constexpr std::array<std::string_view, 22> ablations{
20 "co-scheduling", // nvCOMP claims a batch only if it finishes before the host loaders
21 "read-depth", // readers keep parallel_read_depth reads in flight, not one per loader
22 "probe-depth", // 4 * parallel_read_depth gzip probes in flight, not parallel_read_depth
23 "pinned-pool", // device-only pinned pools that keep their pages, not CCCL-like ones
24 "numa-pool", // device-written pinned buffers on the device's host NUMA node
25 "pinned-reservation", // packed-word buffers pinned before the loaders start
26 "input-lanes", // GPU lanes sized from the input, not a fixed 1 GiB
27 "simd-parsing", // AVX2/AVX-512/NEON line scans, compaction, packing and gzip scans
28 "base-packing", // the CPU path packs bases into two-bit words before copying them
29 "kmer-encoding", // the GPU builds eight windows per thread from shared SWAR-packed tiles
30 "deltas", // near-duplicate rows corrected from a base row, not compared in full
31 "bit-slicing", // exhaustive search on bit-planes, not packed row-major 16-bit scores
32 "lop3-kernel", // the tiled LOP3 plane kernel, not one bucket per lane step
33 "tile-queue", // ranks claim all-to-all tiles from a shared counter, not a fixed split
34 "progress-thread", // rank 0 drives MPI progress for the shared tile counter
35 "match-filter", // a low-plane bound selects candidates before exact refinement
36 "posting-bitmaps", // long posting lists of the inverted index are kept as bitmaps
37 "index-fallback", // an index whose lists cover too many pairs is bypassed
38 "inverted-index", // threshold searches use an inverted index (benchmarks only)
39 "direct-io", // result files are written with O_DIRECT, not through the page cache
40 "io-uring", // direct result writes keep several blocks in flight with io_uring
41 "write-probe", // writers that need not be durable use the page cache while it is faster
42};
43
44#if CUDDL_ABLATIONS
46inline constexpr bool ablations_enabled = true;
47
52inline bool ablated(std::string_view name) noexcept {
53 static auto const list = [] {
54 char const* const value = std::getenv("CUDDL_ABLATE");
55 std::string_view const text = value == nullptr ? std::string_view{} : value;
56 for (size_t start = 0; start < text.size();) {
57 auto end = text.find(',', start);
58 if (end == std::string_view::npos) end = text.size();
59 auto const item = text.substr(start, end - start);
60 if (!item.empty() && std::ranges::find(ablations, item) == ablations.end()) {
61 std::fprintf(
62 stderr, "CUDDL_ABLATE: unknown ablation '%.*s'\n", int(item.size()), item.data()
63 );
64 std::abort();
65 }
66 start = end + 1;
67 }
68 return text;
69 }();
70 for (size_t start = 0; start < list.size();) {
71 auto end = list.find(',', start);
72 if (end == std::string_view::npos) end = list.size();
73 if (list.substr(start, end - start) == name) return true;
74 start = end + 1;
75 }
76 return false;
77}
78#else
79inline constexpr bool ablations_enabled = false;
80
82constexpr bool ablated(std::string_view) noexcept {
83 return false;
84}
85#endif
86
87} // namespace cuddl::detail
constexpr std::array< std::string_view, 22 > ablations
Optimisations that the CUDDL_ABLATE environment variable can turn off in a build configured with -Dab...
Definition ablation.hpp:19
constexpr bool ablations_enabled
Definition ablation.hpp:79
constexpr bool ablated(std::string_view) noexcept
Always false: this build compiles the ablation switches out.
Definition ablation.hpp:82