ista-daslab-optimizers 0.0.1__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ista_daslab_optimizers-0.0.1/ista_daslab_optimizers.egg-info → ista_daslab_optimizers-1.0.0}/PKG-INFO +42 -23
- ista_daslab_optimizers-1.0.0/README.md +73 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0/ista_daslab_optimizers.egg-info}/PKG-INFO +42 -23
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/pyproject.toml +4 -4
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/setup.py +7 -10
- ista_daslab_optimizers-0.0.1/README.md +0 -54
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/LICENSE +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/MANIFEST.in +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/__init__.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/acdc/__init__.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/acdc/acdc.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/acdc/wd_scheduler.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/dense_mfac/__init__.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/dense_mfac/dense_core_mfac.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/dense_mfac/dense_mfac.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/micro_adam/__init__.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/micro_adam/micro_adam.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/sparse_mfac/__init__.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/sparse_mfac/sparse_core_mfac_w_ef.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/sparse_mfac/sparse_mfac.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/tools.py +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers.egg-info/SOURCES.txt +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers.egg-info/dependency_links.txt +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers.egg-info/requires.txt +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers.egg-info/top_level.txt +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/dense_mfac/dense_mfac.cpp +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/dense_mfac/dense_mfac_kernel.cu +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/micro_adam/micro_adam.cpp +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/micro_adam/micro_adam_asymm_block_quant.cu +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/micro_adam/micro_adam_asymm_block_quant_inv.cu +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/micro_adam/micro_adam_update.cu +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/sparse_mfac/sparse_mfac.cpp +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/sparse_mfac/sparse_mfac_LCG_kernel.cu +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/sparse_mfac/sparse_mfac_SP_kernel.cu +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/tools/tools.cpp +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/tools/tools_kernel.cu +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/utils.h +0 -0
- {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ista_daslab_optimizers
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Deep Learning optimizers developed in the Distributed Algorithms and Systems group (DASLab) @ Institute of Science and Technology Austria (ISTA)
|
|
5
5
|
Author-email: Ionut-Vlad Modoranu <ionut-vlad.modoranu@ist.ac.at>
|
|
6
6
|
Maintainer-email: Ionut-Vlad Modoranu <ionut-vlad.modoranu@ist.ac.at>
|
|
@@ -208,9 +208,9 @@ License: Apache License
|
|
|
208
208
|
|
|
209
209
|
Project-URL: Repository, https://github.com/IST-DASLab/ISTA-DASLab-Optimizers
|
|
210
210
|
Keywords: adaptive optimization,deep learning,low memory optimization
|
|
211
|
-
Classifier: Programming Language :: Python :: 3.
|
|
211
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
212
212
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
213
|
-
Requires-Python: >=3.
|
|
213
|
+
Requires-Python: >=3.8
|
|
214
214
|
Description-Content-Type: text/markdown
|
|
215
215
|
License-File: LICENSE
|
|
216
216
|
Requires-Dist: torch>=2.3.1
|
|
@@ -227,40 +227,47 @@ Requires-Dist: psutil>=5.9.8
|
|
|
227
227
|
This repository contains optimization algorithms for Deep Learning developed by
|
|
228
228
|
the Distributed Algorithms and Systems lab at Institute of Science and Technology Austria.
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
- **
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
230
|
+
The repository contains code for the following optimizers published by DASLab @ ISTA:
|
|
231
|
+
- **AC/DC**:
|
|
232
|
+
- paper: [AC/DC: Alternating Compressed/DeCompressed Training of Deep Neural Networks](https://arxiv.org/abs/2106.12379)
|
|
233
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/ACDC)
|
|
234
|
+
- **M-FAC**:
|
|
235
|
+
- paper: [M-FAC: Efficient Matrix-Free Approximations of Second-Order Information](https://arxiv.org/abs/2107.03356)
|
|
236
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/M-FAC)
|
|
237
|
+
- **Sparse M-FAC with Error Feedback**:
|
|
238
|
+
- paper: [Error Feedback Can Accurately Compress Preconditioners](https://arxiv.org/abs/2306.06098)
|
|
239
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/EFCP/)
|
|
240
|
+
- **MicroAdam**:
|
|
241
|
+
- paper: [MicroAdam: Accurate Adaptive Optimization with Low Space Overhead and Provable Convergence](https://arxiv.org/abs/2405.15593)
|
|
242
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/MicroAdam)
|
|
237
243
|
|
|
238
244
|
### Installation
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
245
|
+
To use the latest stable version of the repository, you can install via pip:
|
|
246
|
+
|
|
247
|
+
```shell
|
|
248
|
+
pip3 install ista-daslab-optimizers
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
We also provide a script `install.sh` that creates a new environment, installs requirements
|
|
252
|
+
and then installs the project as a Python package following these steps:
|
|
253
|
+
|
|
242
254
|
```shell
|
|
243
255
|
git clone git@github.com:IST-DASLab/ISTA-DASLab-Optimizers.git
|
|
244
256
|
cd ISTA-DASLab-Optimizers
|
|
245
257
|
source install.sh
|
|
246
258
|
```
|
|
247
259
|
|
|
248
|
-
### ⚠️ Important Notice ⚠️
|
|
249
|
-
We noticed it is useful to compile the kernels for each individual CUDA capability separately. For example, for CUDA capability (CC) 8.6,
|
|
250
|
-
the CUDA kernels for `MicroAdam` will be installed in the package `micro_adam_sm86`, while for CC 9.0 it will be installed in the package
|
|
251
|
-
`micro_adam_sm90`. Please install this library for each system where the CC is different to cover all possible cases for your system. The
|
|
252
|
-
code will automatically detect the CC version and import the correct package if installed, otherwise will throw an error. The code that
|
|
253
|
-
dynamically detects the CC version can be found
|
|
254
|
-
[here](https://github.com/IST-DASLab/ISTA-DASLab-Optimizers/blob/main/ista_daslab_optimizers/tools.py#L17).
|
|
255
|
-
|
|
256
260
|
## How to use optimizers?
|
|
257
261
|
|
|
258
|
-
|
|
262
|
+
In this repository we provide a minimal working example for CIFAR-10 for optimizers `acdc`, `dense_mfac`, `sparse_mfac` and `micro_adam`:
|
|
259
263
|
```shell
|
|
260
|
-
|
|
264
|
+
cd examples/cifar10
|
|
265
|
+
OPTIMIZER=micro_adam # or any other optimizer listed above
|
|
261
266
|
bash run_${OPTIMIZER}.sh
|
|
262
267
|
```
|
|
263
268
|
|
|
269
|
+
To integrate the optimizers into your own pipeline, you can use the following snippets:
|
|
270
|
+
|
|
264
271
|
### MicroAdam optimizer
|
|
265
272
|
```python
|
|
266
273
|
from ista_daslab_optimizers import MicroAdam
|
|
@@ -277,3 +284,15 @@ optimizer = MicroAdam(
|
|
|
277
284
|
|
|
278
285
|
# from now on, you can use the variable `optimizer` as any other PyTorch optimizer
|
|
279
286
|
```
|
|
287
|
+
|
|
288
|
+
# Versions summary:
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
- **1.0.0** @ June 20th, 2024:
|
|
293
|
+
|
|
294
|
+
- changed minimum required Python version to 3.8+ and torch to 2.3.0+
|
|
295
|
+
|
|
296
|
+
- **0.0.1** @ June 13th, 2024:
|
|
297
|
+
|
|
298
|
+
- added initial version of the package for Python 3.9+ and torch 2.3.1+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# ISTA DAS Lab Optimization Algorithms Package
|
|
2
|
+
This repository contains optimization algorithms for Deep Learning developed by
|
|
3
|
+
the Distributed Algorithms and Systems lab at Institute of Science and Technology Austria.
|
|
4
|
+
|
|
5
|
+
The repository contains code for the following optimizers published by DASLab @ ISTA:
|
|
6
|
+
- **AC/DC**:
|
|
7
|
+
- paper: [AC/DC: Alternating Compressed/DeCompressed Training of Deep Neural Networks](https://arxiv.org/abs/2106.12379)
|
|
8
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/ACDC)
|
|
9
|
+
- **M-FAC**:
|
|
10
|
+
- paper: [M-FAC: Efficient Matrix-Free Approximations of Second-Order Information](https://arxiv.org/abs/2107.03356)
|
|
11
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/M-FAC)
|
|
12
|
+
- **Sparse M-FAC with Error Feedback**:
|
|
13
|
+
- paper: [Error Feedback Can Accurately Compress Preconditioners](https://arxiv.org/abs/2306.06098)
|
|
14
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/EFCP/)
|
|
15
|
+
- **MicroAdam**:
|
|
16
|
+
- paper: [MicroAdam: Accurate Adaptive Optimization with Low Space Overhead and Provable Convergence](https://arxiv.org/abs/2405.15593)
|
|
17
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/MicroAdam)
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
To use the latest stable version of the repository, you can install via pip:
|
|
21
|
+
|
|
22
|
+
```shell
|
|
23
|
+
pip3 install ista-daslab-optimizers
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
We also provide a script `install.sh` that creates a new environment, installs requirements
|
|
27
|
+
and then installs the project as a Python package following these steps:
|
|
28
|
+
|
|
29
|
+
```shell
|
|
30
|
+
git clone git@github.com:IST-DASLab/ISTA-DASLab-Optimizers.git
|
|
31
|
+
cd ISTA-DASLab-Optimizers
|
|
32
|
+
source install.sh
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## How to use optimizers?
|
|
36
|
+
|
|
37
|
+
In this repository we provide a minimal working example for CIFAR-10 for optimizers `acdc`, `dense_mfac`, `sparse_mfac` and `micro_adam`:
|
|
38
|
+
```shell
|
|
39
|
+
cd examples/cifar10
|
|
40
|
+
OPTIMIZER=micro_adam # or any other optimizer listed above
|
|
41
|
+
bash run_${OPTIMIZER}.sh
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
To integrate the optimizers into your own pipeline, you can use the following snippets:
|
|
45
|
+
|
|
46
|
+
### MicroAdam optimizer
|
|
47
|
+
```python
|
|
48
|
+
from ista_daslab_optimizers import MicroAdam
|
|
49
|
+
|
|
50
|
+
model = MyCustomModel()
|
|
51
|
+
|
|
52
|
+
optimizer = MicroAdam(
|
|
53
|
+
model.parameters(), # or some custom parameter groups
|
|
54
|
+
m=10, # sliding window size (number of gradients)
|
|
55
|
+
lr=1e-5, # change accordingly
|
|
56
|
+
quant_block_size=100_000, # 32 or 64 also works
|
|
57
|
+
k_init=0.01, # float between 0 and 1 meaning percentage: 0.01 means 1%
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# from now on, you can use the variable `optimizer` as any other PyTorch optimizer
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
# Versions summary:
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
- **1.0.0** @ June 20th, 2024:
|
|
68
|
+
|
|
69
|
+
- changed minimum required Python version to 3.8+ and torch to 2.3.0+
|
|
70
|
+
|
|
71
|
+
- **0.0.1** @ June 13th, 2024:
|
|
72
|
+
|
|
73
|
+
- added initial version of the package for Python 3.9+ and torch 2.3.1+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ista_daslab_optimizers
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Deep Learning optimizers developed in the Distributed Algorithms and Systems group (DASLab) @ Institute of Science and Technology Austria (ISTA)
|
|
5
5
|
Author-email: Ionut-Vlad Modoranu <ionut-vlad.modoranu@ist.ac.at>
|
|
6
6
|
Maintainer-email: Ionut-Vlad Modoranu <ionut-vlad.modoranu@ist.ac.at>
|
|
@@ -208,9 +208,9 @@ License: Apache License
|
|
|
208
208
|
|
|
209
209
|
Project-URL: Repository, https://github.com/IST-DASLab/ISTA-DASLab-Optimizers
|
|
210
210
|
Keywords: adaptive optimization,deep learning,low memory optimization
|
|
211
|
-
Classifier: Programming Language :: Python :: 3.
|
|
211
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
212
212
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
213
|
-
Requires-Python: >=3.
|
|
213
|
+
Requires-Python: >=3.8
|
|
214
214
|
Description-Content-Type: text/markdown
|
|
215
215
|
License-File: LICENSE
|
|
216
216
|
Requires-Dist: torch>=2.3.1
|
|
@@ -227,40 +227,47 @@ Requires-Dist: psutil>=5.9.8
|
|
|
227
227
|
This repository contains optimization algorithms for Deep Learning developed by
|
|
228
228
|
the Distributed Algorithms and Systems lab at Institute of Science and Technology Austria.
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
- **
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
230
|
+
The repository contains code for the following optimizers published by DASLab @ ISTA:
|
|
231
|
+
- **AC/DC**:
|
|
232
|
+
- paper: [AC/DC: Alternating Compressed/DeCompressed Training of Deep Neural Networks](https://arxiv.org/abs/2106.12379)
|
|
233
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/ACDC)
|
|
234
|
+
- **M-FAC**:
|
|
235
|
+
- paper: [M-FAC: Efficient Matrix-Free Approximations of Second-Order Information](https://arxiv.org/abs/2107.03356)
|
|
236
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/M-FAC)
|
|
237
|
+
- **Sparse M-FAC with Error Feedback**:
|
|
238
|
+
- paper: [Error Feedback Can Accurately Compress Preconditioners](https://arxiv.org/abs/2306.06098)
|
|
239
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/EFCP/)
|
|
240
|
+
- **MicroAdam**:
|
|
241
|
+
- paper: [MicroAdam: Accurate Adaptive Optimization with Low Space Overhead and Provable Convergence](https://arxiv.org/abs/2405.15593)
|
|
242
|
+
- official repository: [GitHub](https://github.com/IST-DASLab/MicroAdam)
|
|
237
243
|
|
|
238
244
|
### Installation
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
245
|
+
To use the latest stable version of the repository, you can install via pip:
|
|
246
|
+
|
|
247
|
+
```shell
|
|
248
|
+
pip3 install ista-daslab-optimizers
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
We also provide a script `install.sh` that creates a new environment, installs requirements
|
|
252
|
+
and then installs the project as a Python package following these steps:
|
|
253
|
+
|
|
242
254
|
```shell
|
|
243
255
|
git clone git@github.com:IST-DASLab/ISTA-DASLab-Optimizers.git
|
|
244
256
|
cd ISTA-DASLab-Optimizers
|
|
245
257
|
source install.sh
|
|
246
258
|
```
|
|
247
259
|
|
|
248
|
-
### ⚠️ Important Notice ⚠️
|
|
249
|
-
We noticed it is useful to compile the kernels for each individual CUDA capability separately. For example, for CUDA capability (CC) 8.6,
|
|
250
|
-
the CUDA kernels for `MicroAdam` will be installed in the package `micro_adam_sm86`, while for CC 9.0 it will be installed in the package
|
|
251
|
-
`micro_adam_sm90`. Please install this library for each system where the CC is different to cover all possible cases for your system. The
|
|
252
|
-
code will automatically detect the CC version and import the correct package if installed, otherwise will throw an error. The code that
|
|
253
|
-
dynamically detects the CC version can be found
|
|
254
|
-
[here](https://github.com/IST-DASLab/ISTA-DASLab-Optimizers/blob/main/ista_daslab_optimizers/tools.py#L17).
|
|
255
|
-
|
|
256
260
|
## How to use optimizers?
|
|
257
261
|
|
|
258
|
-
|
|
262
|
+
In this repository we provide a minimal working example for CIFAR-10 for optimizers `acdc`, `dense_mfac`, `sparse_mfac` and `micro_adam`:
|
|
259
263
|
```shell
|
|
260
|
-
|
|
264
|
+
cd examples/cifar10
|
|
265
|
+
OPTIMIZER=micro_adam # or any other optimizer listed above
|
|
261
266
|
bash run_${OPTIMIZER}.sh
|
|
262
267
|
```
|
|
263
268
|
|
|
269
|
+
To integrate the optimizers into your own pipeline, you can use the following snippets:
|
|
270
|
+
|
|
264
271
|
### MicroAdam optimizer
|
|
265
272
|
```python
|
|
266
273
|
from ista_daslab_optimizers import MicroAdam
|
|
@@ -277,3 +284,15 @@ optimizer = MicroAdam(
|
|
|
277
284
|
|
|
278
285
|
# from now on, you can use the variable `optimizer` as any other PyTorch optimizer
|
|
279
286
|
```
|
|
287
|
+
|
|
288
|
+
# Versions summary:
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
- **1.0.0** @ June 20th, 2024:
|
|
293
|
+
|
|
294
|
+
- changed minimum required Python version to 3.8+ and torch to 2.3.0+
|
|
295
|
+
|
|
296
|
+
- **0.0.1** @ June 13th, 2024:
|
|
297
|
+
|
|
298
|
+
- added initial version of the package for Python 3.9+ and torch 2.3.1+
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools", "wheel", "torch>=2.3.
|
|
2
|
+
requires = ["setuptools", "wheel", "torch>=2.3.0"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name='ista_daslab_optimizers'
|
|
7
|
-
version='0.0
|
|
7
|
+
version='1.0.0'
|
|
8
8
|
dependencies = [
|
|
9
9
|
"torch>=2.3.1",
|
|
10
10
|
"torchaudio>=2.3.1",
|
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
|
16
16
|
"einops>=0.8.0",
|
|
17
17
|
"psutil>=5.9.8",
|
|
18
18
|
]
|
|
19
|
-
requires-python = '>= 3.
|
|
19
|
+
requires-python = '>= 3.8'
|
|
20
20
|
authors = [
|
|
21
21
|
{name = "Ionut-Vlad Modoranu", email = "ionut-vlad.modoranu@ist.ac.at"}
|
|
22
22
|
]
|
|
@@ -32,7 +32,7 @@ keywords = [
|
|
|
32
32
|
"low memory optimization",
|
|
33
33
|
]
|
|
34
34
|
classifiers = [
|
|
35
|
-
"Programming Language :: Python :: 3.
|
|
35
|
+
"Programming Language :: Python :: 3.8",
|
|
36
36
|
"License :: OSI Approved :: Apache Software License",
|
|
37
37
|
]
|
|
38
38
|
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
from setuptools import setup, find_packages
|
|
2
2
|
from torch.utils.cpp_extension import CUDAExtension, BuildExtension
|
|
3
|
-
import os
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
"""
|
|
5
|
+
How to add headers when building the project using `python3 -m build` (https://stackoverflow.com/a/6681343/22855002)
|
|
6
|
+
- Add the relative path to MANIFEST.in file
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
What didn't work:
|
|
9
|
+
- headers parameter of setup function
|
|
10
|
+
- include_dirs parameter of CUDAExtension
|
|
11
|
+
"""
|
|
13
12
|
|
|
14
13
|
def get_cuda_extension(name, sources):
|
|
15
14
|
return CUDAExtension(
|
|
16
15
|
name=name,
|
|
17
16
|
sources=sources,
|
|
18
|
-
# include_dirs=['/nfs/scistore19/alistgrp/imodoran/workplace/ISTA-DASLab-Optimizers/kernels'],
|
|
19
|
-
# library_dirs=[kernels_dir],
|
|
20
17
|
)
|
|
21
18
|
|
|
22
19
|
setup(
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# ISTA DAS Lab Optimization Algorithms Package
|
|
2
|
-
This repository contains optimization algorithms for Deep Learning developed by
|
|
3
|
-
the Distributed Algorithms and Systems lab at Institute of Science and Technology Austria.
|
|
4
|
-
|
|
5
|
-
## Project status
|
|
6
|
-
- **June 5th, 2024**:
|
|
7
|
-
- *DONE*: the project is locally installable via `pip install .`
|
|
8
|
-
- *NEXT*:
|
|
9
|
-
- working on examples for Sparse M-FAC and Dense M-FAC
|
|
10
|
-
- **May 27th, 2024**:
|
|
11
|
-
- we are currently working on solving the issues with the installation via `pip`.
|
|
12
|
-
|
|
13
|
-
### Installation
|
|
14
|
-
We provide a script `install.sh` that creates a new environment, installs requirements
|
|
15
|
-
and then builds the optimizers project. First of all, you have to clone this repository, then
|
|
16
|
-
run the installation script.
|
|
17
|
-
```shell
|
|
18
|
-
git clone git@github.com:IST-DASLab/ISTA-DASLab-Optimizers.git
|
|
19
|
-
cd ISTA-DASLab-Optimizers
|
|
20
|
-
source install.sh
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### ⚠️ Important Notice ⚠️
|
|
24
|
-
We noticed it is useful to compile the kernels for each individual CUDA capability separately. For example, for CUDA capability (CC) 8.6,
|
|
25
|
-
the CUDA kernels for `MicroAdam` will be installed in the package `micro_adam_sm86`, while for CC 9.0 it will be installed in the package
|
|
26
|
-
`micro_adam_sm90`. Please install this library for each system where the CC is different to cover all possible cases for your system. The
|
|
27
|
-
code will automatically detect the CC version and import the correct package if installed, otherwise will throw an error. The code that
|
|
28
|
-
dynamically detects the CC version can be found
|
|
29
|
-
[here](https://github.com/IST-DASLab/ISTA-DASLab-Optimizers/blob/main/ista_daslab_optimizers/tools.py#L17).
|
|
30
|
-
|
|
31
|
-
## How to use optimizers?
|
|
32
|
-
|
|
33
|
-
We provide a minimal working example with ResNet-18 and CIFAR-10 for optimizers `micro-adam`, `acdc`, `sparse-mfac`, `dense-mfac`:
|
|
34
|
-
```shell
|
|
35
|
-
OPTIMIZER=micro-adam # or any other optimizer listed above
|
|
36
|
-
bash run_${OPTIMIZER}.sh
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### MicroAdam optimizer
|
|
40
|
-
```python
|
|
41
|
-
from ista_daslab_optimizers import MicroAdam
|
|
42
|
-
|
|
43
|
-
model = MyCustomModel()
|
|
44
|
-
|
|
45
|
-
optimizer = MicroAdam(
|
|
46
|
-
model.parameters(), # or some custom parameter groups
|
|
47
|
-
m=10, # sliding window size (number of gradients)
|
|
48
|
-
lr=1e-5, # change accordingly
|
|
49
|
-
quant_block_size=100_000, # 32 or 64 also works
|
|
50
|
-
k_init=0.01, # float between 0 and 1 meaning percentage: 0.01 means 1%
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
# from now on, you can use the variable `optimizer` as any other PyTorch optimizer
|
|
54
|
-
```
|
|
File without changes
|
|
File without changes
|
{ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/acdc/acdc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/ista_daslab_optimizers/tools.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/dense_mfac/dense_mfac.cpp
RENAMED
|
File without changes
|
|
File without changes
|
{ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/micro_adam/micro_adam.cpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.0}/kernels/sparse_mfac/sparse_mfac.cpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|