Repository navigation
hydra-kll: one key per label set, measured at ~100 / 1k / 10k groups (#165) - #169
Closed
milindsrivastava1997 wants to merge 2 commits into
Closed
milindsrivastava1997 wants to merge 2 commits into
milindsrivastava1997 wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three specs differ only in key1's population (2 / 20 / 200 values over key2's ~50), and the export runs every hydra-kll config on each. The optimizer's group-count gate picks among them with no code change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closed, because my undersanding of Hydra-KLL was wrong. If we want to maintain a set of KLLs, we cannot just maintain a Hydra like structure over it because that might only provide error guarantees for point queries, not for enumerating all keys. Similar to how, CMS only provides guarantees for point queries, and some heavy hitters, ot all queries. |
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.
Closes #165.
The hydra-kll rows inserted every sample into all
2^D − 1label subsets, becauseasap_sketchlib0.2.2'sHydra::updatesplits keys on;. The optimizer models one key per grouping. This PR makes the rows measure that sketch, at several group counts.Design decisions (settled in a grilling session; please approve each)
asap_sketchlib's Hydra as it ships, and nothing consumes them.Hydra. The hydra-kll rows join label values with\u{1f}(SERIES_SEPARATOR) instead of;, soHydra::updatesees one part. Queries join with the same separator. The join happens at materialisation (peel_series), outside the timed insert.subpop-rank-errorfor hydra-kll groups by every label column, not just key1. The polars baseline groups by the full key (nofan_out), sosubpopulationsis the number of distinct label sets, which is what the optimizer'scard(G) ≤ subpopulationsgate assumes.measured_at_group_countcomment inrqe-optimizer/src/candidates.rs, which cited this issue, is updated.HYDRA_KLL_CONFIGSentry on each spec, merge-accuracy runs included. No pipeline or optimizer change is needed:same_cellkeys on the full table description, so the specs are separate cells, and every cost row is its own candidate, gated by its ownsubpopulations.Out of scope:
HydraKllSketch(xxh32, its own KLL,k=20by default), not the frameworkHydrameasured here. Neither fans out, but their costs can differ. This is tracked in HydraKLL: the costed sketch (sketch-bench Hydra framework) is not the deployed one (portable HydraKllSketch) ASAPQuery#799. We decided to keep measuring the frameworkHydra.Changes
aqpbm-cli/src/rows/materialise.rs:peel_seriesjoins labels withSERIES_SEPARATOR;peel_labeled(;) is unchanged for the other rows.aqpbm-cli/src/rows/statistic.rs:subpop_quantile_rowusespeel_seriesand groups by every label column.sketch-bench/src/wrappers/hydra_kll/:SERIES_SEPARATOR. The lib wrapper queries the joined key; the polars baseline groups by the full key. The tests use full label sets, and a new test,kll_record_is_not_inserted_under_its_label_subsets, checks there is no fan-out.configs/datagen/hydra_kll_disjoint_labels_{100,1k,10k}.yaml:_10kis the old spec renamed, with its fan-out comments fixed.scripts/export_rqe_optimizer_costs.sh: loops overHYDRA_KLL_GROUP_COUNTS=(100 1k 10k).rqe-optimizer/src/candidates.rs: comment only.Verification
Subpopulation rank error at
rows=3 cols=256 cell_k=200, seed 42:_100_1k_10kI ran one config through
flattenandatomic-costson all three specs: it gave 3 rows, 0 skipped, each with its own merge accuracy.cargo testand the rest of the pre-commit checks pass. I haven't run the full export script or regenerated the cost table.🤖 Generated with Claude Code