Skip to content
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

[ENH]: add crate to manage datasets for benchmarking #2797

Merged
merged 9 commits into from
Sep 24, 2024

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented Sep 14, 2024

Description of changes

Adds a new crate, benchmark-datasets. Contains utils to download, cache, and stream from three separate datasets: an English Wikipedia article snapshot, the SciDocs corpus, and the Microsoft MARCO search query dataset.

Additionally, there are helpers to construct a subset of search queries where every query in the subset has at least N results in a specified corpus.

Test plan

How are these changes tested?

Partly tested in rust/benchmark-datasets/src/types.rs, but will be more comprehensively consumed in the next PR in this stack.

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

n/a

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@codetheweb codetheweb force-pushed the feat-benchmark-datasets branch 3 times, most recently from 3cc654c to c221e99 Compare September 17, 2024 22:11
Copy link
Contributor Author

codetheweb commented Sep 17, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @codetheweb and the rest of your teammates on Graphite Graphite

@codetheweb codetheweb force-pushed the feat-benchmark-datasets branch 2 times, most recently from c5ab47a to f958d1a Compare September 19, 2024 23:26
@codetheweb codetheweb marked this pull request as ready for review September 19, 2024 23:26
/// Returns a subset of queries from the dataset that have at least `min_results_per_query` results in the `corpus_dataset`.
/// The subset will contain at most `max_num_of_queries` queries.
///
/// Because constructing this subset can be expensive (and different subsets may lead to different downstream test results), by default the constructed subset is stored in the `dataset_files/` directory in the root of this crate.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use git lfs for that folder maybe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are pretty small, assuming queries with say an average of 32 bytes 10,000 queries (more than we would ever need) is only 320 kB.

let client = reqwest::Client::new();
let response = client
.get(
"https://www.dropbox.com/s/wwnfnu441w1ec9p/wiki-articles.json.bz2?dl=1", // todo: less sketchy source
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Collaborator

@HammadB HammadB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

@codetheweb codetheweb force-pushed the feat-benchmark-datasets branch 2 times, most recently from d7332a1 to 0605be1 Compare September 20, 2024 22:31
Copy link
Contributor Author

codetheweb commented Sep 24, 2024

Merge activity

  • Sep 24, 12:38 PM EDT: @codetheweb started a stack merge that includes this pull request via Graphite.
  • Sep 24, 12:40 PM EDT: Graphite rebased this pull request as part of a merge.
  • Sep 24, 12:41 PM EDT: @codetheweb merged this pull request with Graphite.

@codetheweb codetheweb merged commit be5e527 into main Sep 24, 2024
68 checks passed
@codetheweb codetheweb deleted the feat-benchmark-datasets branch September 24, 2024 16:47
drewkim pushed a commit that referenced this pull request Sep 24, 2024
## Description of changes

Adds a new crate, `benchmark-datasets`. Contains utils to download, cache, and stream from three separate datasets: an English Wikipedia article snapshot, the SciDocs corpus, and the Microsoft MARCO search query dataset.

Additionally, there are helpers to construct a subset of search queries where every query in the subset has at least N results in a specified corpus.

## Test plan
*How are these changes tested?*

Partly tested in `rust/benchmark-datasets/src/types.rs`, but will be more comprehensively consumed in the next PR in this stack.

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs repository](https://github.com/chroma-core/docs)?*

n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants