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

Throws an error when params in optimizer are not the same as that of module's in make_private #439

Closed
wants to merge 2 commits into from

Conversation

deepakagrawal
Copy link

Summary: Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Jun 15, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

Copy link
Contributor

@karthikprasad karthikprasad left a comment

Choose a reason for hiding this comment

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

Thanks Deepak! Looks good. Could you also add a simple unit test in privacy_engine_test for this check?

@karthikprasad karthikprasad added this to the 1.1.3 milestone Jun 15, 2022
deepakagrawal pushed a commit to deepakagrawal/opacus that referenced this pull request Jun 17, 2022
…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

fbshipit-source-id: 73a8c3b5afa1b1e080c6fe7ed77a4a6130c9fdf9
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

deepakagrawal pushed a commit to deepakagrawal/opacus that referenced this pull request Jun 17, 2022
…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

fbshipit-source-id: 8e25fa1738f08c5aa52f856023f72948164d6f0e
@karthikprasad
Copy link
Contributor

Thanks for adding the tests @deepakagrawal! Please also fix the lint failure and it is good to go after that :)

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

deepakagrawal pushed a commit to deepakagrawal/opacus that referenced this pull request Jun 17, 2022
…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

fbshipit-source-id: 96cd2bc3ce9a136e450d5927b602b82f8072af9c
deepakagrawal pushed a commit to deepakagrawal/opacus that referenced this pull request Jun 17, 2022
…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

fbshipit-source-id: de7e96f02d0d3d711032c9d77e22ae48bb06f0bb
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

deepakagrawal pushed a commit to deepakagrawal/opacus that referenced this pull request Jun 17, 2022
…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

fbshipit-source-id: 5098af6123c4280119276bd7a7d0310118fc8914
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

deepakagrawal pushed a commit to deepakagrawal/opacus that referenced this pull request Jun 17, 2022
…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

fbshipit-source-id: b4e27d4b7879c5804424b2d1b18921409073d267
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

deepakagrawal pushed a commit to deepakagrawal/opacus that referenced this pull request Jun 17, 2022
…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

fbshipit-source-id: cf2d89ae50ed7387406a0cea362994fb975d2db1
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

deepakagrawal pushed a commit to deepakagrawal/opacus that referenced this pull request Jun 17, 2022
…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Differential Revision: D37163873

fbshipit-source-id: b2f9d3d6e4efda335ff47e110593d96b19188094
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

@deepakagrawal
Copy link
Author

@karthikprasad can you please check the errors. I think they are not related to the changes I made. I fixed the lint failure.

Copy link
Contributor

@karthikprasad karthikprasad left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you @deepakagrawal!

…module's in `make_private` (pytorch#439)

Summary:
Pull Request resolved: pytorch#439

Compare nn.Module.parameters() with list of parameters from all param_groups of optimizer. If they are all not equal then raise error "Module parameters are different than optimizer Parameters"

Reviewed By: karthikprasad

Differential Revision: D37163873

fbshipit-source-id: daca6711570dd7006c1aaf7f757c3d81dbaaeda1
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37163873

@deepakagrawal
Copy link
Author

deepakagrawal commented Jun 20, 2022

@karthikprasad pushed the latest commit to github. I will land the diff as well. Can you please merge this on github.

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. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print a warning/throw an error when params in optimizer are not the same as that of module's in make_private
3 participants