Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

The docstring for _config_from_args showed vars(args).copy() as the recommended pattern for model_config, which pollutes the RLlib model config with all CLI args (env_type, seed, lr, iterations, etc.).

Changes

  • New utility functions in ray_utilities/training/helpers.py:

    • filter_model_config() - filters dict to only valid DefaultModelConfig keys
    • get_valid_model_config_keys() - returns frozenset of 30 valid model config fields
  • Updated docstring in ExperimentSetupBase._config_from_args:

    • Changed example to use cls._model_config_from_args(args)
    • Added warning about never using vars(args).copy() for model_config
  • Replaced FIXME with informative note referencing filter_model_config()

Usage

# Before (wrong - includes all CLI args)
model_config=vars(args).copy()

# After (correct - only model config keys)
model_config=cls._model_config_from_args(args)

# Or filter manually
from ray_utilities.training import filter_model_config
model_config = filter_model_config({"fcnet_hiddens": [64], "env_type": "CartPole-v1"})
# Returns: {"fcnet_hiddens": [64]}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • metadata.google.internal
    • Triggering command: /usr/bin/python3 /usr/bin/python3 /home/REDACTED/.local/lib/python3.12/site-packages/ray/dashboard/dashboard.py --host=127.0.0.1 --port=8265 --port-retries=50 --temp-dir=/tmp/ray --log-dir=/tmp/ray/session_2025-12-01_17-34-49_048217_3535/logs --session-dir=/tmp/ray/session_2025-12-01_17-34-49_048217_3535 --logging-rotate-bytes=536870912 --logging-rotate-backup-count=5 --gcs-address=127.0.0.1:59374 --cluster-id-hex=618cbdd95c3b276fac2037fdefb63494f7cc9870b8b975c2d7c7a83d --node-ip-address=127.0.0.1 --stdout-filepath=/tmp/ray/session_2025-12-01_17-34-49_048217_3535/logs/dashboard.out --stderr-filepath=/tmp/ray/session_2025-12-01_17-34-49_048217_3535/logs/dashboard.err --minimal (dns block)
    • Triggering command: /usr/bin/python3 /usr/bin/python3 /home/REDACTED/.local/lib/python3.12/site-packages/ray/dashboard/dashboard.py --host=127.0.0.1 --port=8265 --port-retries=50 --temp-dir=/tmp/ray --log-dir=/tmp/ray/session_2025-12-01_17-40-09_175512_4073/logs --session-dir=/tmp/ray/session_2025-12-01_17-40-09_175512_4073 --logging-rotate-bytes=536870912 --logging-rotate-backup-count=5 --gcs-address=127.0.0.1:44788 --cluster-id-hex=f89bbdf727c74cd408c022a176f09679889e66bea1f4ad72d4f92bac --node-ip-address=127.0.0.1 --stdout-filepath=/tmp/ray/session_2025-12-01_17-40-09_175512_4073/logs/dashboard.out --stderr-filepath=/tmp/ray/session_2025-12-01_17-40-09_175512_4073/logs/dashboard.err --minimal (dns block)
    • Triggering command: /usr/bin/python3 /usr/bin/python3 /home/REDACTED/.local/lib/python3.12/site-packages/ray/dashboard/dashboard.py --host=127.0.0.1 --port=8265 --port-retries=50 --temp-dir=/tmp/ray --log-dir=/tmp/ray/session_2025-12-01_17-41-40_165688_4488/logs --session-dir=/tmp/ray/session_2025-12-01_17-41-40_165688_4488 --logging-rotate-bytes=536870912 --logging-rotate-backup-count=5 --gcs-address=127.0.0.1:52612 --cluster-id-hex=5ac2ae30eeae194a133c7f255c767bdb82cdc4901deea48821a569b8 --node-ip-address=127.0.0.1 --stdout-filepath=/tmp/ray/session_2025-12-01_17-41-40_165688_4488/logs/dashboard.out --stderr-filepath=/tmp/ray/session_2025-12-01_17-41-40_165688_4488/logs/dashboard.err --minimal (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Work on TODO: too much info in model_config (most cli args are present there), i.e will also contain methods of the parser. Possibly vars(args) or similar was stored in there. Figure out where this happens fix it so that these invalid keys are no longer in the model config. (from ray_utilities/training/helpers.py)

Created from VS Code via the GitHub Pull Request extension.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix invalid keys in model_config by removing excessive information Add filter_model_config utility and fix incorrect docstring example Dec 1, 2025
Copilot AI requested a review from Daraan December 1, 2025 17:48
@Daraan Daraan force-pushed the main branch 4 times, most recently from a28d4f5 to 4d9fc66 Compare December 5, 2025 05:51
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.

2 participants