Skip to content

Enable fast WOSAC evals on large datasets with resampling#280

Merged
daphne-cornelisse merged 13 commits into2.0from
dc/wosac_eval_with_resampling
Feb 6, 2026
Merged

Enable fast WOSAC evals on large datasets with resampling#280
daphne-cornelisse merged 13 commits into2.0from
dc/wosac_eval_with_resampling

Conversation

@daphne-cornelisse
Copy link
Copy Markdown

@daphne-cornelisse daphne-cornelisse commented Feb 6, 2026

Description

Problem

When evaluating WOSAC on large datasets, the current implementation loads all target scenes into memory simultaneously, leading to excessive memory consumption and potential out-of-memory errors.

Solution

This PR refactors the evaluation pipeline to iterate through datasets incrementally, loading and processing scenes one at a time rather than all at once.

Usage

  • Configure the sampling parameters like this:
[eval]
; Number of scenarios to process in each batch
wosac_batch_size = 10
; Target number of unique scenarios perform evaluation in
wosac_target_scenarios = 50
; Total number of scenarios to sample from
wosac_scenario_pool_size = 1000
  • Run:
puffer eval puffer_drive --eval.wosac-realism-eval True

>>> Running WOSAC realism evaluation with training dataset. 

Collecting rollout 14/32...████████████████████████████                                                | 40/100 [00:10<00:16,  3.73%/s, n=20, batch=4]

...

Implentation

  • Refactor resample scenes logic into a separate function
  • Use the util function in training and eval code
  • Simplify sampling logic: num_maps -> num_agents mapping is done under the hood in WOSAC eval so that users can think in scene units (easier for WOSAC eval purposes)

@daphne-cornelisse daphne-cornelisse marked this pull request as ready for review February 6, 2026 16:08
greptile-apps[bot]

This comment was marked as resolved.

@Emerge-Lab Emerge-Lab deleted a comment from greptile-apps Bot Feb 6, 2026
@daphne-cornelisse daphne-cornelisse changed the title Enable fast WOSAC evals on large datasets with resampling. Enable fast WOSAC evals on large datasets with resampling Feb 6, 2026
Copy link
Copy Markdown

@WaelDLZ WaelDLZ left a comment

Choose a reason for hiding this comment

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

Nice !

@daphne-cornelisse daphne-cornelisse merged commit ec149b8 into 2.0 Feb 6, 2026
14 checks passed
@daphne-cornelisse daphne-cornelisse deleted the dc/wosac_eval_with_resampling branch February 6, 2026 22:44
JinkaiQiu pushed a commit to JinkaiQiu/PufferDrive that referenced this pull request Feb 26, 2026
…#280)

* Improve random map resampling code.

* Refactor env: Create separate resampling function.

* Works with wosac_use_map_as_resampling_target = False.

* More elegant and clean solution to map resampling.

* Clean up.

* Put batch iteration in the WOSACEvaluator class to avoid repetition (keep puffer code clean).

* Improve naming.

* Clean up code and drop duplicates.

* Fix util functions so that we can run wosac during training.

* Log more metrics to wandb.

* Remove unused variable map_idex.

* Fix human replay eval.

* Drop last scenario from batch as a safety measure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants