Commit graph

8 commits

Author SHA1 Message Date
Ann Shan
7cc1efec13 Add lite SequentialSampler to torch mobile (#43299)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/43299

Test Plan: Imported from OSS

Reviewed By: iseeyuan

Differential Revision: D23228415

Pulled By: ann-ss

fbshipit-source-id: eebe54353a128783f039c7dac0e2dd765a61940d
2020-08-24 09:45:24 -07:00
Ann Shan
dd194c1612 add _save_parameters to serialize map (#43163)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/43163

Test Plan: Imported from OSS

Reviewed By: iseeyuan

Differential Revision: D23175287

Pulled By: ann-ss

fbshipit-source-id: ddfd734513c07e8bdbec108f26d1ca1770d098a6
2020-08-18 14:58:04 -07:00
Ann Shan
2e6e295ecc refactor _save_parameters to _save_data (#43162)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/43162

Test Plan: Imported from OSS

Reviewed By: iseeyuan

Differential Revision: D23175286

Pulled By: ann-ss

fbshipit-source-id: 6f930b98c367242fd4efbf51cb1d09995f7c4b40
2020-08-18 14:57:03 -07:00
Ann Shan
13bc542829 Fix lite trainer unit test submodule registration (#42714)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42714

Change two unit tests for the lite trainer to register two instances/objects of the same submodule type instead of the same submodule object twice.

Test Plan: Imported from OSS

Reviewed By: iseeyuan

Differential Revision: D22990736

Pulled By: ann-ss

fbshipit-source-id: 2bf56b5cc438b5a5fc3db90d3f30c5c431d3ae77
2020-08-07 18:26:56 -07:00
Ann Shan
d707d4bf6d Implement a light SGD optimizer (#42137)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42137

This PR implements an SGD optimizer class similar to torch::optim::SGD, but it doesn't inherit from torch::optim::Optimizer, for use on mobile devices (or other lightweight use case).

Adding Martin's comment for visibility: "SGD may be the only optimizer used in near future. If more client optimizers are needed, refactoring the full optim codes and reusing the existing code would be an option."

Test Plan: Imported from OSS

Reviewed By: iseeyuan

Differential Revision: D22846514

Pulled By: ann-ss

fbshipit-source-id: f5f46804aa021e7ada7c0cd3f16e24404d10c7eb
2020-08-03 17:27:53 -07:00
Ann Shan
4b108ca763 refactor save_data as non member function (#42045)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42045

This PR changes the save_data() member functions of torch::jit::mobile::Module which was introduced in #41403 to be the non member function torch::jit::mobile::_save_parameters() (taking a mobile Module as its first argument).

In addition, this PR:
* adds a getter function _ivalue() for the mobile::Module object
* renames torch::jit::mobile::_load_mobile_data() to torch::jit::mobile_load_parameters()
* refactors the import.h header file into import.h and import_data.h

Test Plan: Imported from OSS

Reviewed By: kwanmacher, iseeyuan

Differential Revision: D22766781

Pulled By: ann-ss

fbshipit-source-id: 5cabae31927187753a958feede5e9a28d71d9e92
2020-07-28 21:52:32 -07:00
Ann Shan
dfe7d27d0e implement lite parameter serializer (#41403)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/41403

Test Plan: Imported from OSS

Reviewed By: kwanmacher

Differential Revision: D22611633

Pulled By: ann-ss

fbshipit-source-id: b391e8c96234b2e69f350119a11f688e920c7817
2020-07-23 14:25:44 -07:00
Ann Shan
1039bbf4eb add named parameters to mobile module (#41376)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41376

torch::jit::mobile::Module does not currently support accessing parameters via their attribute names, but torch::jit::Module does. This diff adds an equivalent functionality to mobile::Module.

Test Plan: Imported from OSS

Reviewed By: iseeyuan

Differential Revision: D22609142

Pulled By: ann-ss

fbshipit-source-id: 1a5272ff336f99a3c0bb6194c6a6384754f47846
2020-07-20 15:57:49 -07:00