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

Run Torchvision problems with Benchmark[Problem/Runner/Metric]; consolidate PyTorchCNN problems #2688

Closed
wants to merge 1 commit into from

Conversation

esantorella
Copy link
Contributor

Summary:
Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:

  • Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
  • Merge the functionality in pytorch_cnn.py into torchvision.py; it was only ever used in order to support torchvision.py.
  • Remove PyTorchCNNTorchvisionBenchmarkProblem and its special serialization logic; it is replaced with BenchmarkProblem
  • Remove PyTorchCNNTorchvisionRunner, PyTorchCNNBenchmarkProblem, PyTorchCNNMetric, and PyTorchCNNRunner
  • Introduce PyTorchCNNTorchvisionParamBasedProblem. It does not need special serialization logic because it is a dataclass with datasets constructed in the __post_init__. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
  • Use BenchmarkRunner; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Differential Revision: D61414680

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 21, 2024
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 21, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 22, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 22, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 22, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 22, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 23, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 98.61111% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.39%. Comparing base (cc05718) to head (1c042f8).
Report is 1 commits behind head on main.

Files Patch % Lines
ax/utils/testing/benchmark_stubs.py 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2688      +/-   ##
==========================================
+ Coverage   95.28%   95.39%   +0.10%     
==========================================
  Files         493      492       -1     
  Lines       47919    47916       -3     
==========================================
+ Hits        45662    45711      +49     
+ Misses       2257     2205      -52     

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 23, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Differential Revision: D61414680

Reviewed By: Balandat
esantorella added a commit to esantorella/Ax that referenced this pull request Aug 24, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Differential Revision: D61414680

Reviewed By: Balandat
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 24, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 24, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
esantorella added a commit to esantorella/Ax that referenced this pull request Aug 24, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Differential Revision: D61414680

Reviewed By: Balandat
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 24, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
esantorella added a commit to esantorella/Ax that referenced this pull request Aug 24, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Differential Revision: D61414680

Reviewed By: Balandat
esantorella added a commit to esantorella/Ax that referenced this pull request Aug 25, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Differential Revision: D61414680

Reviewed By: Balandat
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 25, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 26, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
esantorella added a commit to esantorella/Ax that referenced this pull request Aug 26, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Differential Revision: D61414680

Reviewed By: Balandat
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 26, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 26, 2024
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
…lidate PyTorchCNN problems (facebook#2688)

Summary:
Pull Request resolved: facebook#2688

Context: Consolidating on common abstractions will make it easier to add functionality to all classes. Also, this will make the code smaller and easier to navigate. This diff is substantially LOC-negative outside of tests.

This PR:
* Updates functionality in torchvision.py that replaces MNIST datasets with fakes when run in a test environment; the data sets are now realistic enough to be usable.
* Merge the functionality in `pytorch_cnn.py` into `torchvision.py`; it was only ever used in order to support `torchvision.py`.
* Remove `PyTorchCNNTorchvisionBenchmarkProblem` and its special serialization logic; it is replaced with `BenchmarkProblem`
* Remove `PyTorchCNNTorchvisionRunner`, `PyTorchCNNBenchmarkProblem`, `PyTorchCNNMetric`, and `PyTorchCNNRunner`
* Introduce `PyTorchCNNTorchvisionParamBasedProblem`. It does not need special serialization logic because it is a dataclass with datasets constructed in the `__post_init__`. When an instance is serialized, the data sets are not serialized; they are reconstructed when the instance is decoded. Using a dataclass here also allows for an automatic and more rigorous equality check.
* Use `BenchmarkRunner`; as per D61483962, this means that this problem now has a ground truth, which won't change its behavior since it doesn't have noise added.

Reviewed By: Balandat

Differential Revision: D61414680
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in f1d2f88.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants