Skip to content

feat: multi-ROM support for vectorized environments#694

Open
AdrianOrenstein wants to merge 6 commits into
Farama-Foundation:mainfrom
AdrianOrenstein:feat/multi-rom
Open

feat: multi-ROM support for vectorized environments#694
AdrianOrenstein wants to merge 6 commits into
Farama-Foundation:mainfrom
AdrianOrenstein:feat/multi-rom

Conversation

@AdrianOrenstein

@AdrianOrenstein AdrianOrenstein commented Jun 1, 2026

Copy link
Copy Markdown

Extends AtariVectorEnv to accept multiple ROMs, enabling parallel training across seeds and games.

Previously, all environments in AtariVectorEnv ran the same ROM. Now rom_paths accepts
a list, and num_envs replicates each ROM: ["pong", "breakout"] with num_envs=2 expands
to ["pong", "pong", "breakout", "breakout"].

Renames:

  • ALEVectorInterface.rom_path -> rom_paths
  • AtariVectorEnv.game -> games
  • AtariVectorEnv.get_action_set -> get_action_sets

Action space:
action_space now covers all ROMs and no longer changes with batch size. Previously,
action space varied with batch size, breaking training scripts that held a reference to it.
action_space is now MultiDiscrete; single_action_space is None unless the full
action space is used, in which case it is always 16.

TestVectorEnv::test_batch_size_async is updated to reflect this.

@AdrianOrenstein

Copy link
Copy Markdown
Author

@pseudo-rnd-thoughts Ready for your review.

Comment thread src/ale/python/vector_env.py Outdated
@AdrianOrenstein

Copy link
Copy Markdown
Author

@pseudo-rnd-thoughts please let me know if there's anything else to do for this PR 😄

@jkterry1

Copy link
Copy Markdown
Member

Hey just as a cursory question, could you help me understand what this is a feature that people would want? Perhaps I'm just missing something quite obvious.

@AdrianOrenstein

Copy link
Copy Markdown
Author

Hey @jkterry1, here are some reasons people would want multi-rom support to be part of the vector interface:

  1. Running many roms in parallel helps run more experiments at once. This feature increases the throughput by 40% compared to running multiple python processes. I have my experiment in this blog post where I ran 57 unique ROMs and multiple seeds per ROM.
image
  1. If we can run multiple roms per environment instance, we can more easily evaluate agents that learn to play many games in their lifetime. Or agents that can switch between ROMs. I believe this PR will open up more challenging scenarios to evaluate RL algorithms.

@jkterry1

jkterry1 commented Jul 9, 2026

Copy link
Copy Markdown
Member

@AdrianOrenstein can you please get CI to pass?

@AdrianOrenstein AdrianOrenstein force-pushed the feat/multi-rom branch 2 times, most recently from b83f9a0 to 391b17c Compare July 10, 2026 16:28
@AdrianOrenstein

Copy link
Copy Markdown
Author

@jkterry1 Thanks for pinging me. It should be ready for review now.

@jkterry1

Copy link
Copy Markdown
Member

@AdrianOrenstein could you please rebase off main?

- EnvVectorizer constructor takes vector<fs::path> rom_paths directly;
  action_sets_ stores per-environment action sets via action_sets()
- ALEVectorInterface binding takes rom_paths + num_envs multiplier via
  expand_rom_paths helper; parse_autoreset_mode accepts canonical PascalCase
- AtariVectorEnv accepts games: list[str]|str with optional num_envs
  multiplier; action space is always MultiDiscrete over all environments
@AdrianOrenstein

Copy link
Copy Markdown
Author

@jkterry1 ready for CI

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