Commit da6dbc8
PoC: Accelerator refactor (#5743)
* restoring the result from subprocess
* fix queue.get() order for results
* add missing "block_backward_sync" context manager
* add missing "block_backward_sync" context manager
* fix sync_batchnorm
* fix supported gpu-ids for tuple
* fix clip gradients and inf recursion
* accelerator selection: added cluster_environment plugin
* fix torchelastic test
* fix reduce early stopping decision for DDP
* fix tests: callbacks, conversion to lightning optimizer
* fix lightning optimizer does not pickle
* fix setting benchmark and deterministic option
* fix slurm amp test
* fix prepare_data test and determine node_rank
* fix retrieving last path when testing
* remove obsolete plugin argument
* fix test: test_trainer_config
* fix torchscript tests
* fix trainer.model access
* move properties
* fix test_transfer_batch_hook
* fix auto_select_gpus
* fix omegaconf test
* fix test that needs to simulate slurm ddp
* add horovod plugin
* fix test with named arguments
* clean up whitespace
* fix datamodules test
* remove old accelerators
* fix naming
* move old plugins
* move to plugins
* create precision subpackage
* create training_type subpackage
* fix all new import errors
* fix wrong arguments order passed to test
* fix LR finder
* Added sharded training type and amp plugin
* Move clip grad to precision plugin
* Added sharded spawn, select accelerators based on distributed_backend + enable custom fp16 plugin automatically
* Fix import issue, attempting to fix tests
* Fix initial test
* Reflect hook logic from master, should wrap model after move to device
* Optional state consolidation, since master has optimizers not wrapped
* change attribute for instance test
* reset optimizers
optimizers are not used in main process, so state would be wrong.
* legacy
* imports in accel
* legacy2
* trainer imports
* fix import errors after rebase
* move hook to new setup location
* provide unwrapping logic
* fix trainer callback system
* added ddp2 implementation
* fix imports .legacy
* move plugins
* restore legacy
* drop test.py from root
* add tpu accelerator and plugins
* fixes
* fix lightning optimizer merge
* reset bugreportmodel
* unwrapping
* step routing forward
* model access
* unwrap
* opt
* integrate distrib_type
* sync changes
* sync
* fixes
* add forgotten generators
* add missing logic
* update
* import
* missed imports
* import fixes
* isort
* mv f
* changelog
* format
* move helper to parallel plugin
* d
* add world size
* clean up
* duplicate
* activate ddp_sharded and tpu
* set nvidia flags
* remove unused colab var
* use_tpu <-> on_tpu attrs
* make some ddp_cpu and clusterplugin tests pass
* Ref/accelerator connector (#5742)
* final cleanup
Co-authored-by: Adrian Wälchli <[email protected]>
* connector cleanup
Co-authored-by: Adrian Wälchli <[email protected]>
* trainer cleanup
Co-authored-by: Adrian Wälchli <[email protected]>
* accelerator cleanup + missing logic in accelerator connector
Co-authored-by: Adrian Wälchli <[email protected]>
* add missing changes to callbacks
Co-authored-by: Adrian Wälchli <[email protected]>
* reflect accelerator changes to lightning module
Co-authored-by: Adrian Wälchli <[email protected]>
* clean cluster envs
Co-authored-by: Adrian Wälchli <[email protected]>
* cleanup plugins
Co-authored-by: Adrian Wälchli <[email protected]>
* add broadcasting
Co-authored-by: Adrian Wälchli <[email protected]>
* yapf
* remove plugin connector
Co-authored-by: Adrian Wälchli <[email protected]>
* plugins
* manual optimization
* update optimizer routing
* add rank to torchelastic
* fix memory mixed precision
* setstate on trainer for pickling in ddp spawn
* add predict method
* add back commented accelerator code
* adapt test for sync_batch_norm to new plugin
* fix deprecated tests
* fix ddp cpu choice when no num_processes are given
* yapf format
* skip a memory test that cannot pass anymore
* fix pickle error in spawn plugin
* x
* avoid
* x
* fix cyclic import in docs build
* add support for sharded
* update typing
* add sharded and sharded_spawn to distributed types
* make unwrap model default
* refactor LightningShardedDataParallel similar to LightningDistributedDataParallel
* update sharded spawn to reflect changes
* update sharded to reflect changes
* Merge 1.1.5 changes
* fix merge
* fix merge
* yapf isort
* fix merge
* yapf isort
* fix indentation in test
* copy over reinit scheduler implementation from dev1.2
* fix apex tracking calls with dev_debugger
* reduce diff to dev1.2, clean up
* fix trainer config test when gpus>0 and num_processes >0 and ddp_cpu
* sort plugin tests legacy/new
* fix error handling for amp on cpu
* fix merge
fix merge
fix merge
* [Feat] Resolve manual_backward (#5837)
* resolve manual_backward
* resolve flake8
* update
* resolve for ddp_spawn
* resolve flake8
* resolve flake8
* resolve flake8
Co-authored-by: Ubuntu <[email protected]>
* fix tests/accelerator tests on cpu
* [BugFix] Resolve manual optimization (#5852)
* resolve manual_optimization
* update
* update
Co-authored-by: Ubuntu <[email protected]>
* Remove copy trainer parameters to happen earlier within the loop and add safe guard to get ref model (#5856)
* resovle a bug
* Accelerator refactor sharded rpc (#5854)
* rpc branch
* merge
* update handling of rpc
* make devices etc. Optional in RPC
* set devices etc. later if necessary
* remove devices from sequential
* make devices optional in rpc
* fix import
* uncomment everything
* fix cluster selection
Co-authored-by: Ubuntu <[email protected]>
* resolve bug
* fix assert in rpc test
* resolve a test
* fix docs compilation
* accelerator refactor - fix for sharded parity test (#5866)
* fix memory issue with ddp_spawn
* x
x
x
x
x
x
x
x
x
* x
* Remove DDP2 as this does not apply
* Add missing pre optimizer hook to ensure lambda closure is called
* fix apex docstring
* [accelerator][BugFix] Resolve some test for 1 gpu (#5863)
* update
* revert init
* resolve a bug
* update
* resolve flake8
* update
* update
* update
* revert init
* resolve a bug
* update
* resolve flake8
* update
* update
* update
* update
* update
* revert init
* resolve a bug
* update
* resolve flake8
* update
* update
* update
* revert init
* update
* resolve flake8
* update
* update
* update
* update
* update
* all_gather
* update
* make plugins work, add misconfig for RPC
* update
* update
* remove breaking test
* resolve some tests
* resolve flake8
* revert to ddp_spawn
Co-authored-by: root <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: Justus Schock <[email protected]>
* yapf isort
* resolve flake8
* fix apex doctests
* fix apex doctests 2
* resolve docs
* update drone
* clean env
* update
* update
* update
* update
* merge
* Fix RPC related tests, clean out old API, update for new accelerator API [skip ci] (#5881)
* Fix RPC related tests, clean out old API, update for new accelerator API
* Move tests out of legacy folder, update paths and names
* Update test_remove_1-4.py
* Expose properties for tpu cores/gpus/num_gpus
* Add root GPU property
* Move properties to properties.py
* move tests that were previously in drone
* Fix root GPU property (#5908)
* Move root GPU to property, remove horovod set as this is handled in horovod plugin, ensure we mock correctly to set GPU accelerator
* Add missing tests back
* fix best model path transfer when no checkpoint callback available
* Fix setup hook order [wip] (#5858)
* Call trainer setup hook before accelerator setup
* Add test case
* add new test
* typo
* fix callback order in test
Co-authored-by: tchaton <[email protected]>
Co-authored-by: Adrian Wälchli <[email protected]>
* rename ddp sequential -> rpc sequential for special test
* revert
* fix stupid merge problem
* Use property in connector for sampler (#5913)
* merge the import conflicts
* fix spawning of processes in slurm
* [wip] Fix some bugs for TPU [skip ci] (#5878)
* fixed for single tpu
* fixed spawn
* fixed spawn
* update
* update
* wip
* resolve bugs
* resolve bug
* update on comment
* removed decorator
* resolve comments
* set to 4
* update
* update
* need cleaning
* update
* update
* update
* resolve flake8
* resolve bugs
* exclude broadcast
* resolve bugs
* change test
* update
* update
* skip if meet fails
* properly raise trace
* update
* add catch
* wrap test
* resolve typo
* update
* typo
Co-authored-by: Lezwon Castelino <[email protected]>
Co-authored-by: Your Name <[email protected]>
* resolve some tests
* update
* fix imports
* update
* resolve flake8
* update azure pipeline
* skip a sharded test on cpu that requires a gpu
* resolve tpus
* resolve bug
* resolve flake8
* update
* updat utils
* revert permission change on files
* suggestions from carlos
Co-authored-by: Carlos Mocholí <[email protected]>
* remove unrelated formatting changes
* remove incomplete comment
* Update pytorch_lightning/accelerators/__init__.py
Co-authored-by: Carlos Mocholí <[email protected]>
* remove unrelated formatting change
* add types
* warn 1.7 ddp manual backward only if ddp kwarg unset
* yapf + isort
* pep8 unused imports
* fix cyclic import in docs
* Apply suggestions from code review
* typer in accelerator.py
* typo
* Apply suggestions from code review
* formatting
* update on comments
* update typo
* Update pytorch_lightning/trainer/properties.py
Co-authored-by: Adrian Wälchli <[email protected]>
* update
* suggestion from code review
* suggestion from code review
Co-authored-by: Adrian Wälchli <[email protected]>
Co-authored-by: SeanNaren <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
Co-authored-by: chaton <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: Sean Naren <[email protected]>
Co-authored-by: root <[email protected]>
Co-authored-by: Lezwon Castelino <[email protected]>
Co-authored-by: Your Name <[email protected]>
Co-authored-by: Carlos Mocholí <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>1 parent 309ce7a commit da6dbc8
File tree
92 files changed
+1685
-1678
lines changed- benchmarks
- dockers/tpu-tests
- docs/source
- advanced
- common
- pytorch_lightning
- accelerators
- legacy
- callbacks
- core
- loggers
- overrides
- plugins
- environments
- precision
- training_type
- trainer
- connectors
- logger_connector
- utilities
- tests
- accelerators/legacy
- callbacks
- checkpointing
- core
- deprecated_api
- helpers
- models
- plugins
- legacy
- trainer
- optimization
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
92 files changed
+1685
-1678
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | | - | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
| |||
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | | - | |
52 | | - | |
53 | 48 | | |
54 | 49 | | |
55 | 50 | | |
| |||
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
64 | | - | |
65 | | - | |
66 | 59 | | |
67 | 60 | | |
68 | 61 | | |
| |||
76 | 69 | | |
77 | 70 | | |
78 | 71 | | |
79 | | - | |
80 | | - | |
81 | 72 | | |
82 | 73 | | |
83 | 74 | | |
| |||
91 | 82 | | |
92 | 83 | | |
93 | 84 | | |
94 | | - | |
95 | | - | |
96 | 85 | | |
97 | 86 | | |
98 | 87 | | |
| |||
108 | 97 | | |
109 | 98 | | |
110 | 99 | | |
111 | | - | |
112 | | - | |
113 | 100 | | |
114 | 101 | | |
115 | 102 | | |
| |||
124 | 111 | | |
125 | 112 | | |
126 | 113 | | |
127 | | - | |
128 | | - | |
129 | 114 | | |
130 | 115 | | |
131 | 116 | | |
| |||
139 | 124 | | |
140 | 125 | | |
141 | 126 | | |
142 | | - | |
143 | 127 | | |
144 | | - | |
145 | 128 | | |
146 | 129 | | |
147 | 130 | | |
| |||
156 | 139 | | |
157 | 140 | | |
158 | 141 | | |
159 | | - | |
160 | 142 | | |
161 | | - | |
162 | 143 | | |
163 | 144 | | |
164 | 145 | | |
| |||
260 | 241 | | |
261 | 242 | | |
262 | 243 | | |
263 | | - | |
264 | 244 | | |
265 | | - | |
266 | 245 | | |
267 | 246 | | |
268 | 247 | | |
| |||
273 | 252 | | |
274 | 253 | | |
275 | 254 | | |
276 | | - | |
277 | 255 | | |
278 | | - | |
279 | 256 | | |
280 | 257 | | |
281 | 258 | | |
| |||
293 | 270 | | |
294 | 271 | | |
295 | 272 | | |
296 | | - | |
| 273 | + | |
297 | 274 | | |
298 | 275 | | |
299 | 276 | | |
| |||
307 | 284 | | |
308 | 285 | | |
309 | 286 | | |
310 | | - | |
311 | | - | |
| 287 | + | |
312 | 288 | | |
| 289 | + | |
313 | 290 | | |
314 | 291 | | |
315 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1178 | 1178 | | |
1179 | 1179 | | |
1180 | 1180 | | |
1181 | | - | |
| 1181 | + | |
1182 | 1182 | | |
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
1187 | | - | |
| 1187 | + | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments