Repository navigation
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] ANNs for clustering at training time #1938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
[WIP] ANNs for clustering at training time #1938
Changes from 1 commit
9fd71ef80070c4fa6fd70d8543a6d26e916ad054af0f14da1e69259f1d765168e62682167f0c464586adde80d267daf9cb76ebb73525cd4c1673e3939512481daabbe52ddd3d3de082373825bdFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
The cluster-assignment and fit-tuning benchmarks used uniform random data, which has no cluster structure, and the assignment benchmark used independent random vectors as centroids. Both now read every dataset, real or synthetic, from a big-ann style .fbin file, so there is one code path. Centroids are always trained from the dataset rather than drawn at random. Dataset input (cpp/bench/ann/src/cuvs/bench_dataset.hpp, new) CUVS_BENCH_DATA_FBIN names the dataset and CUVS_BENCH_CENTROIDS_FBIN the trained centroids. - data_path, centroids_path: the two environment variables. - read_header: row count and dim from the 8-byte .fbin header. - read_first_rows: first N rows to the host, checking row count and dim. - load_data: copies the first N points to the GPU. Used by both benchmarks. - load_centroids: copies K centroids, taken at an even stride, to the GPU. Used by the assignment benchmark, so a smaller K still spans the whole centroid set. - write_fbin: writes trained centroids. Used by centroid training. cuvs_cluster_assignment_bench.cu (panels 1-6, 8) - Removed the uniform-random data and random-centroid paths. - load_benchmark_data: loads the points and centroids for each benchmark. - size_is_supported, g_dim, g_n_rows, g_n_centroids, kMaxDataBytes: every sweep skips (N, K, dim) combinations the files cannot serve or that do not fit on the GPU. - configure_dataset_from_env: reads both headers in main and fails with instructions if either file is missing. - train_centroids_from_env: with CUVS_BENCH_TRAIN_CENTROIDS_OUT set, trains K centroids (CUVS_BENCH_TRAIN_K, default 300K) on the first CUVS_BENCH_TRAIN_N rows (default 5M) using brute-force balanced k-means, so the centroids are not biased by the ANN path being measured, then writes them as .fbin and exits. - The dimension sweep (panel 8) only runs for the dataset's own dim. cuvs_fit_ann_rebuild_tuning_bench.cu (panel 7) - Loads points with load_data instead of generating random ones. - register_all replaces the BENCHMARK macros so dim can come from the file. It requires CUVS_BENCH_DATA_FBIN and skips sizes the file cannot serve. - New counter ann_1nn_agreement_pct_itopk32 next to 64 and 256; 32 is CAGRA's minimum. scripts/generate_clustered_dataset.py (new) Writes a synthetic .fbin from a Gaussian mixture with uneven component weights and spreads, for use when no real dataset is available. scripts/plot_all_cluster_assignment_benchmarks.py - Panel 4: replaced the (N, K) heatmap with panel4_speedup_by_n, a line chart of speedup (brute-force time / CAGRA time) against K with one line per N, a 1x break-even line and shaded "CAGRA faster" / "brute force faster" regions. Lines for different N show how much N matters at each K. - --dim argument replaces the hard-coded 128 in panels 1-6. - Panel 8 prints a placeholder when the data has a single dim. - Panel 7: shows the itopk_size 32 agreement; both y axes now contain 1.0 at the same height so one dashed line means "same as brute force" for quality and speed; the distance-ratio axis spans at least +/-5% so run-to-run noise is not stretched to fill the plot, and every point stays inside the axes.Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.