Skip to content

MAINT: Excluding large datasets from automatic scenario-default loading - #2484

Closed
jbolor21 wants to merge 3 commits into
microsoft:mainfrom
jbolor21:jbolor/integration_test_datasets
Closed

MAINT: Excluding large datasets from automatic scenario-default loading#2484
jbolor21 wants to merge 3 commits into
microsoft:mainfrom
jbolor21:jbolor/integration_test_datasets

Conversation

@jbolor21

@jbolor21 jbolor21 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

Prevent  LoadDefaultDatasets  from exhausting integration-test memory by excluding large package registries from automatic scenario-default loading.

A previous PR introduced four large Garak datasets (npm, PyPI, RubyGems, and crates.io) whose registries contain roughly 4.19 million records combined. They remain registered and available when explicitly selected through  dataset_names  or  tags , but are no longer fetched during a default initialization. The integration test previously discovered and loaded every dataset required by registered scenarios.

  • Marks the four Garak package registries as opt-in for  LoadDefaultDatasets .
  • Preserves explicit loading through  dataset_names  and  tags .
  • Updates the integration test to load three bounded local Garak corpus datasets instead of all registered scenario defaults.

Tests and Documentation:

Add unit coverage for:
• Excluding opt-in registries from implicit loading.
• Loading an opt-in registry when explicitly requested.
• Confirming all opt-in registries remain discoverable.

Comment thread pyrit/setup/initializers/load_default_datasets.py
Comment thread pyrit/setup/initializers/load_default_datasets.py
Comment on lines +25 to +28
"garak_crates_packages",
"garak_npm_packages",
"garak_pypi_packages",
"garak_rubygems_packages",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

curious how you found out that these are "large"? is there a way that we can systematically quantify what "large enough" means so that future datasets are in here? We have SeedDatasetLoadTime but can't tell if we actually use that for anything.

@rlundeen2 Richard Lundeen (rlundeen2) Aug 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This isn't super extensible. Nobody is going to maintain this list. I'd be tempted to do it anyway since it's just an initializer and it will make load_defaults return fast, but an issue is that if we run the scenarios notebook (garak.ipynb) these will still load and it'll still take forever.

I think my fav fix is

  1. revert these changes
  2. Make Rust the default for package hallucination and remove python/ruby/etc. That should reduce the size 20x. Then this function will return fast, and the basic scenario in scanner docs will run fast

@jbolor21 jbolor21 Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just the number of entries in the dataset! PyRIT puts this definition


SeedDatasetSizeCategory = Literal["tiny", "small", "medium", "large", "huge"]
# tiny (<10), small (10-99), medium (100-499), large (500-4999), huge (5000+) ```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

jbolor21 wdyt about my suggestion above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh okay yeah that sounds good! then I'll just close this PR Richard Lundeen (@rlundeen2) ?

@jbolor21 jbolor21 closed this Aug 27, 2026
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.

3 participants