Add filter_model_config utility and fix incorrect docstring example #36
+321
−64
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.
The docstring for
_config_from_argsshowedvars(args).copy()as the recommended pattern formodel_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 keysget_valid_model_config_keys()- returns frozenset of 30 valid model config fieldsUpdated docstring in
ExperimentSetupBase._config_from_args:cls._model_config_from_args(args)vars(args).copy()for model_configReplaced FIXME with informative note referencing
filter_model_config()Usage
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/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)/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)/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
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.