Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast DictConfig -> dict in instantiate #1450

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

ebsmothers
Copy link
Contributor

@ebsmothers ebsmothers commented Aug 29, 2024

Fixes #1444

Tested via

tune run lora_finetune_single_device --config llama2/7B_lora_single_device gradient_accumulation_steps=1
...
1|855|Loss: 0.6323381066322327:   3%|████████████▊                                                                                                                                                                                                                                                                                              | 855/25880 [04:01<2:03:21,  3.38it/s]

Logged type(lora_modules) here.

On main: <class 'omegaconf.listconfig.ListConfig'>
On this PR: <class 'list'>

Copy link

pytorch-bot bot commented Aug 29, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1450

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 87bf24d with merge base 4fba6cd (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 29, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.79%. Comparing base (ec21546) to head (815fddf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1450      +/-   ##
==========================================
- Coverage   70.01%   69.79%   -0.23%     
==========================================
  Files         268      271       +3     
  Lines       12937    13052     +115     
==========================================
+ Hits         9058     9109      +51     
- Misses       3879     3943      +64     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ebsmothers ebsmothers marked this pull request as ready for review August 29, 2024 17:29
@ebsmothers ebsmothers requested a review from RdoubleA August 29, 2024 17:29
Copy link
Contributor

@RdoubleA RdoubleA left a comment

Choose a reason for hiding this comment

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

good thing we have the config instantiation tests for all our configs, otherwise I would be very nervous

@@ -103,4 +103,4 @@ def instantiate(
# Resolve all interpolations, or references to other fields within the same config
OmegaConf.resolve(config)

return _instantiate_node(config, *args)
return _instantiate_node(OmegaConf.to_object(config), *args)
Copy link
Contributor

Choose a reason for hiding this comment

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

we should update the typing of _instantiate_node since now you're passing in a dict instead of DictConfig

@RdoubleA RdoubleA merged commit 5ca9d31 into pytorch:main Aug 29, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

See if config.instantiate should always instantiate dict/list as primitive types
4 participants