Skip to content

Conversation

@gouthamuoc
Copy link

Summary:
sr stands for sampling rate, which is now legacy code. Now, it's just sample_rate = 1 / len(data_loader). This has been fixed in the example and values have been updated.

When running with DP, the following error is thrown

AttributeError: Can't pickle local object 'wrap_collate_with_empty.<locals>.collate'

For now, a temporary fix (based on IBM/Project_CodeNet#21 (comment)) is to make num_workers=0 in the dataset loaders. This commit does that.

Differential Revision: D40253037

@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 Oct 11, 2022
@facebook-github-bot
Copy link
Contributor

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

@ffuuugor
Copy link
Contributor

@gouthamuoc Hi and thanks for your contribution! We've indeed missed on updating the documentation.

However, I would say that having a doc with MNIST classifier training to just 20% accuracy is the the point we want to make. We want to show that it is possible to train a decent classifier (90%+ accuracy) with a given privacy parameters.

--sr 0.004 would be equivalent to --batch-size 240 on MNIST (60000 * 0.004 = 240), so I would suggest updating the run commands, but keeping the loss/accuracy data.
If you prefer round numbers, we can do batch size 256 (the loss/accuracy would probably still be within expected noise and won't need to be updated still)

@gouthamuoc
Copy link
Author

Thanks, I updated accordingly and the test runs give similar accuracy.

Summary:
sr stands for sampling rate, which is now legacy code. Now, it's just sample_rate = 1 / len(data_loader). This has been fixed in the example, by setting batch size to be 60000 * 0.004 = 240 (thanks to https://github.com/ffuuugor for the clarification).

On another note, when running with DP, the following error is thrown
```
AttributeError: Can't pickle local object 'wrap_collate_with_empty.<locals>.collate'
```

For now, a temporary fix (based on IBM/Project_CodeNet#21 (comment)) is to make num_workers=0 in the dataset loaders. This commit does that.

Differential Revision: D40253037

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

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

Copy link
Contributor

@ffuuugor ffuuugor left a comment

Choose a reason for hiding this comment

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

Cool, thanks!

psolikov pushed a commit to psolikov/opacus that referenced this pull request Nov 1, 2022
Summary:
Pull Request resolved: meta-pytorch#520

sr stands for sampling rate, which is now legacy code. Now, it's just sample_rate = 1 / len(data_loader). This has been fixed in the example, by setting batch size to be 60000 * 0.004 = 240 (thanks to https://github.com/ffuuugor for the clarification).

On another note, when running with DP, the following error is thrown
```
AttributeError: Can't pickle local object 'wrap_collate_with_empty.<locals>.collate'
```

For now, a temporary fix (based on IBM/Project_CodeNet#21 (comment)) is to make num_workers=0 in the dataset loaders. This commit does that.

Reviewed By: ffuuugor

Differential Revision: D40253037

fbshipit-source-id: 99984f8963a4efea6829d109bb81acff0e587c93
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.

3 participants