Support per-percentage ground truth datasets via filter_percentage param - #1107
Support per-percentage ground truth datasets via filter_percentage param#1107Likhoram wants to merge 2 commits into
Conversation
PR Reviewer Guide 🔍(Review updated until commit 33653c4)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 33653c4 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 4f4781c
Suggestions up to commit 9127cb4
Suggestions up to commit aff487b
|
There was a problem hiding this comment.
Pull request overview
This PR extends dataset loading to support per-percentage (“10pct”, etc.) ground-truth datasets stored in a single HDF5 file by suffixing the dataset key names when filter_percentage is provided.
Changes:
- Add
filter_percentageworkload param and pass it through when opening neighbors/threshold datasets. - Extend
get_data_set()/HDF5DataSetto accept an optional HDF5 key suffix and append it to the resolved context key.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| osbenchmark/workload/params.py | Adds filter_percentage param and threads it into neighbor/threshold dataset creation. |
| osbenchmark/utils/dataset.py | Adds optional key_suffix support for HDF5 dataset key selection via context_<suffix>. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
aff487b to
9127cb4
Compare
|
Persistent review updated to latest commit 9127cb4 |
| self.radial_engine = "lucene" | ||
| else: | ||
| self.radial_engine = "faiss" | ||
| self.radial_engine = params.get("radial_engine", "faiss") |
There was a problem hiding this comment.
Why do we still have references of radial_engine? I thought you removed the redundant param?
There was a problem hiding this comment.
That's from the old base, the branch predates #1099 where radial engine was removed. The diff showed pre-removal code as context. Rebased onto latest main, the old param is gone now.
| def __init__(self, dataset_path: str, context: Context, key_suffix: str = None): | ||
| self.dataset_path = dataset_path | ||
| self.context = self.parse_context(context) | ||
| if key_suffix: |
There was a problem hiding this comment.
Can we add error handling here? Check if the key exists? If not fail the workload?
Adds optional key_suffix to HDF5 dataset reads. When filter_percentage is set (e.g. "10pct"), the neighbors and radial threshold datasets are read from suffixed keys (neighbors_10pct, faiss_max_distance_10pct), allowing one dataset file to hold precomputed answer sets for multiple filter percentages. Signed-off-by: Wenxin Li <liwenxin@amazon.com>
9127cb4 to
4f4781c
Compare
|
Persistent review updated to latest commit 4f4781c |
Signed-off-by: Wenxin Li <liwenxin@amazon.com>
|
Persistent review updated to latest commit 33653c4 |
Description
Adds optional key_suffix to HDF5 dataset reads. When filter_percentage is set (e.g. "10pct"), the neighbors and radial threshold datasets are read from suffixed keys (neighbors_10pct, faiss_max_distance_10pct), allowing one dataset file to hold precomputed answer sets for multiple filter percentages.
Testing
neighbors_10pct,faiss_max_distance_10pct) and unchanged unsuffixed readsBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.