Skip to content

Conversation

cat-state
Copy link
Collaborator

@cat-state cat-state commented Jan 25, 2023

Currently TRLConfig.update will fail if given something like { "optimizer": { "name": "adam_8bit_bnb" } }" since it'll check if the optimizer key is in updates, but merge won't add it because the only keys updated are nested. merge will check the keys to in every nested dict with the root level keys of the update config, which is problematic when changing an attr that is common across many subconfigs (e.g "name"), so this way allows proper nested updates.

Currently `TRLConfig.update` will fail if given something like `{ "optimizer": { "name": "adam_8bit_bnb" } }" since it'll check if the `optimizer` key is in `updates`, but `merge` won't add it because the only keys updated are nested. Actually currently `merge` will check the values in updates in every nested dict, which is problematic when changing an attr that is common across many subconfigs (e.g `"name"`), so this way allows proper nested updates.
Copy link
Collaborator

@jon-tow jon-tow left a comment

Choose a reason for hiding this comment

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

@cat-state
Copy link
Collaborator Author

@cat-state nice catch pray can repro here https://colab.research.google.com/drive/1RBLvwxh8KQlCjjo1QtkLMXMu4GfxcZoX?usp=sharing

thanks for the repro and test!

@cat-state cat-state merged commit f9715d4 into main Jan 25, 2023
@cat-state cat-state deleted the fix-merge-nested-configs branch January 25, 2023 01:29
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