feat(scan): stream or subsample datasets; avoid duplicate HarmBench loads - #2680
Open
davidberenstein1957 wants to merge 1 commit into
Open
feat(scan): stream or subsample datasets; avoid duplicate HarmBench loads#2680davidberenstein1957 wants to merge 1 commit into
davidberenstein1957 wants to merge 1 commit into
Conversation
Stream JSONL datasets with reservoir sampling instead of loading full corpora before subsampling, and share parsed HarmBench records across generators within a suite via a process-scoped cache. Closes #2669
davidberenstein1957
force-pushed
the
feat/scan-frugal-dataset-loading
branch
from
July 29, 2026 19:48
1d5f727 to
ce2f8fe
Compare
1 task
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 #2669
Summary
iter_jsonlandreservoir_samplehelpers for streaming JSONL and uniform subsampling without full materialization.rng.choice.generate_suiteso HarmBench (and other shared corpora) are parsed once and reused across generators such as plain HF and GCG.ScenarioGenerator.generate_scenario(...)signatures are unchanged.Test plan
make formatmake test-unit PACKAGE=giskard-scan(166 passed)max_scenarios=20returns 20 scenarios via reservoir samplingiter_jsonlparse when cache is active