[FEATURE] Add S3 doc-store option to WikiHow extraction benchmark - #421
Open
noel-improv wants to merge 2 commits into
Open
[FEATURE] Add S3 doc-store option to WikiHow extraction benchmark#421noel-improv wants to merge 2 commits into
noel-improv wants to merge 2 commits into
Conversation
…n benchmark benchmark_extract hardcoded FileBasedDocs (local disk), so the benchmark could not measure S3-backed document storage. Add a BENCHMARK_DOC_STORE env switch: "file" (default, unchanged behaviour) keeps FileBasedDocs; "s3" uses S3BasedDocs, with BENCHMARK_S3_JSONL selecting the per-chunk or JSONL write path. S3BasedDocs uses collection_id=None (timestamp per run) so repeated runs do not accumulate into one collection. A log line records the resolved store, flag, and collection_id. build-tests.sh propagates the two new variables into .env.testing so they reach the notebook; without this they stay local to the caller's shell and the run silently falls back to FileBasedDocs.
noel-improv
marked this pull request as ready for review
July 23, 2026 23:23
…hmark BENCHMARK_DOC_STORE=s3 read AWS_REGION_NAME/S3_RESULTS_BUCKET/S3_RESULTS_PREFIX via plain os.environ[...]. In non-batch (prototype) runs those vars are not otherwise required, so a missing one raised a bare KeyError and aborted the run before extraction. Check them up front and raise a clear ValueError naming the missing variables.
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.
Description
The extraction benchmark hardcoded
FileBasedDocs(local disk), so it could not measure the cost of S3-backed document storage. This adds aBENCHMARK_DOC_STOREswitch in the sharedrun_benchmark_extractpath, so any dataset (ConcurrentQA, WikiHow, PGA) can use it. It defaults to local disk, so with the variable unset every dataset runs as before. The scale runs below use WikiHow.Changes
benchmark_extract.py: readBENCHMARK_DOC_STORE(filedefault, ors3). Whens3, useS3BasedDocswithBENCHMARK_S3_JSONLselecting the per-chunk or JSONL path, andcollection_id=None(timestamp per run) so repeated runs land in separate collections. Log the resolved store, flag, and collection id.benchmark_extract.py: whens3is selected, validateAWS_REGION_NAME/S3_RESULTS_BUCKET/S3_RESULTS_PREFIXare set and raise aValueErrornaming any that are missing, instead of a bareKeyError(these vars are not otherwise required in non-batch prototype runs).build-tests.sh: propagateBENCHMARK_DOC_STOREandBENCHMARK_S3_JSONLinto.env.testingso they reach the notebook.Problem
benchmark_extractbuiltFileBasedDocsunconditionally, so there was no way to benchmark extraction against S3. The switch lives in the shared helper, not one dataset's test, because the document store is a genericNodeHandlerswap that any run should be able to opt into. Thebuild-tests.shchange is needed too: without it the variables stay in the caller's shell, the notebook never sees them, and the run silently falls back toFileBasedDocs.Related issue (if any): #
Testing
pytest)Ran the WikiHow 5,000-doc extraction on a SageMaker notebook across all three settings:
file(33m 33s),s3withBENCHMARK_S3_JSONL=false(42m 21s), ands3withBENCHMARK_S3_JSONL=true. Each run logged the expectedDoc store:line and produced the expected object layout (16,536 per-chunk objects vs one JSONL per source document). The default (file, unset) reproduces the prior behaviour unchanged.Checklist
No new files (existing headers unchanged). Default behaviour is identical to before when the new variables are unset.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.