ista-daslab-optimizers 0.0.1__tar.gz → 1.0.1__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.
Files changed (39) hide show
  1. {ista_daslab_optimizers-0.0.1/ista_daslab_optimizers.egg-info → ista_daslab_optimizers-1.0.1}/PKG-INFO +55 -32
  2. ista_daslab_optimizers-1.0.1/README.md +77 -0
  3. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1/ista_daslab_optimizers.egg-info}/PKG-INFO +55 -32
  4. ista_daslab_optimizers-1.0.1/ista_daslab_optimizers.egg-info/requires.txt +9 -0
  5. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/pyproject.toml +13 -13
  6. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/setup.py +7 -10
  7. ista_daslab_optimizers-0.0.1/README.md +0 -54
  8. ista_daslab_optimizers-0.0.1/ista_daslab_optimizers.egg-info/requires.txt +0 -9
  9. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/LICENSE +0 -0
  10. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/MANIFEST.in +0 -0
  11. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/__init__.py +0 -0
  12. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/acdc/__init__.py +0 -0
  13. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/acdc/acdc.py +0 -0
  14. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/acdc/wd_scheduler.py +0 -0
  15. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/dense_mfac/__init__.py +0 -0
  16. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/dense_mfac/dense_core_mfac.py +0 -0
  17. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/dense_mfac/dense_mfac.py +0 -0
  18. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/micro_adam/__init__.py +0 -0
  19. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/micro_adam/micro_adam.py +0 -0
  20. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/sparse_mfac/__init__.py +0 -0
  21. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/sparse_mfac/sparse_core_mfac_w_ef.py +0 -0
  22. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/sparse_mfac/sparse_mfac.py +0 -0
  23. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers/tools.py +0 -0
  24. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers.egg-info/SOURCES.txt +0 -0
  25. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers.egg-info/dependency_links.txt +0 -0
  26. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/ista_daslab_optimizers.egg-info/top_level.txt +0 -0
  27. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/dense_mfac/dense_mfac.cpp +0 -0
  28. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/dense_mfac/dense_mfac_kernel.cu +0 -0
  29. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/micro_adam/micro_adam.cpp +0 -0
  30. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/micro_adam/micro_adam_asymm_block_quant.cu +0 -0
  31. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/micro_adam/micro_adam_asymm_block_quant_inv.cu +0 -0
  32. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/micro_adam/micro_adam_update.cu +0 -0
  33. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/sparse_mfac/sparse_mfac.cpp +0 -0
  34. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/sparse_mfac/sparse_mfac_LCG_kernel.cu +0 -0
  35. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/sparse_mfac/sparse_mfac_SP_kernel.cu +0 -0
  36. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/tools/tools.cpp +0 -0
  37. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/tools/tools_kernel.cu +0 -0
  38. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/kernels/utils.h +0 -0
  39. {ista_daslab_optimizers-0.0.1 → ista_daslab_optimizers-1.0.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ista_daslab_optimizers
3
- Version: 0.0.1
3
+ Version: 1.0.1
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,59 +208,66 @@ 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.9
211
+ Classifier: Programming Language :: Python :: 3.8
212
212
  Classifier: License :: OSI Approved :: Apache Software License
213
- Requires-Python: >=3.9
213
+ Requires-Python: >=3.8
214
214
  Description-Content-Type: text/markdown
215
215
  License-File: LICENSE
216
- Requires-Dist: torch>=2.3.1
217
- Requires-Dist: torchaudio>=2.3.1
218
- Requires-Dist: torchvision>=0.18.1
219
- Requires-Dist: numpy>=1.24.1
220
- Requires-Dist: wandb>=0.17.1
221
- Requires-Dist: gpustat>=1.1.1
222
- Requires-Dist: timm>=1.0.3
223
- Requires-Dist: einops>=0.8.0
224
- Requires-Dist: psutil>=5.9.8
216
+ Requires-Dist: torch
217
+ Requires-Dist: torchaudio
218
+ Requires-Dist: torchvision
219
+ Requires-Dist: numpy
220
+ Requires-Dist: wandb
221
+ Requires-Dist: gpustat
222
+ Requires-Dist: timm
223
+ Requires-Dist: einops
224
+ Requires-Dist: psutil
225
225
 
226
226
  # ISTA DAS Lab Optimization Algorithms Package
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
- ## Project status
231
- - **June 5th, 2024**:
232
- - *DONE*: the project is locally installable via `pip install .`
233
- - *NEXT*:
234
- - working on examples for Sparse M-FAC and Dense M-FAC
235
- - **May 27th, 2024**:
236
- - we are currently working on solving the issues with the installation via `pip`.
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
- We provide a script `install.sh` that creates a new environment, installs requirements
240
- and then builds the optimizers project. First of all, you have to clone this repository, then
241
- run the installation script.
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
- We provide a minimal working example with ResNet-18 and CIFAR-10 for optimizers `micro-adam`, `acdc`, `sparse-mfac`, `dense-mfac`:
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
- OPTIMIZER=micro-adam # or any other optimizer listed above
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,19 @@ 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.1** @ June 27th, 2024:
293
+
294
+ - removed version in dependencies to avoid conflicts with llm-foundry
295
+
296
+ - **1.0.0** @ June 20th, 2024:
297
+
298
+ - changed minimum required Python version to 3.8+ and torch to 2.3.0+
299
+
300
+ - **0.0.1** @ June 13th, 2024:
301
+
302
+ - added initial version of the package for Python 3.9+ and torch 2.3.1+
@@ -0,0 +1,77 @@
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.1** @ June 27th, 2024:
68
+
69
+ - removed version in dependencies to avoid conflicts with llm-foundry
70
+
71
+ - **1.0.0** @ June 20th, 2024:
72
+
73
+ - changed minimum required Python version to 3.8+ and torch to 2.3.0+
74
+
75
+ - **0.0.1** @ June 13th, 2024:
76
+
77
+ - 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.1
3
+ Version: 1.0.1
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,59 +208,66 @@ 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.9
211
+ Classifier: Programming Language :: Python :: 3.8
212
212
  Classifier: License :: OSI Approved :: Apache Software License
213
- Requires-Python: >=3.9
213
+ Requires-Python: >=3.8
214
214
  Description-Content-Type: text/markdown
215
215
  License-File: LICENSE
216
- Requires-Dist: torch>=2.3.1
217
- Requires-Dist: torchaudio>=2.3.1
218
- Requires-Dist: torchvision>=0.18.1
219
- Requires-Dist: numpy>=1.24.1
220
- Requires-Dist: wandb>=0.17.1
221
- Requires-Dist: gpustat>=1.1.1
222
- Requires-Dist: timm>=1.0.3
223
- Requires-Dist: einops>=0.8.0
224
- Requires-Dist: psutil>=5.9.8
216
+ Requires-Dist: torch
217
+ Requires-Dist: torchaudio
218
+ Requires-Dist: torchvision
219
+ Requires-Dist: numpy
220
+ Requires-Dist: wandb
221
+ Requires-Dist: gpustat
222
+ Requires-Dist: timm
223
+ Requires-Dist: einops
224
+ Requires-Dist: psutil
225
225
 
226
226
  # ISTA DAS Lab Optimization Algorithms Package
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
- ## Project status
231
- - **June 5th, 2024**:
232
- - *DONE*: the project is locally installable via `pip install .`
233
- - *NEXT*:
234
- - working on examples for Sparse M-FAC and Dense M-FAC
235
- - **May 27th, 2024**:
236
- - we are currently working on solving the issues with the installation via `pip`.
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
- We provide a script `install.sh` that creates a new environment, installs requirements
240
- and then builds the optimizers project. First of all, you have to clone this repository, then
241
- run the installation script.
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
- We provide a minimal working example with ResNet-18 and CIFAR-10 for optimizers `micro-adam`, `acdc`, `sparse-mfac`, `dense-mfac`:
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
- OPTIMIZER=micro-adam # or any other optimizer listed above
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,19 @@ 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.1** @ June 27th, 2024:
293
+
294
+ - removed version in dependencies to avoid conflicts with llm-foundry
295
+
296
+ - **1.0.0** @ June 20th, 2024:
297
+
298
+ - changed minimum required Python version to 3.8+ and torch to 2.3.0+
299
+
300
+ - **0.0.1** @ June 13th, 2024:
301
+
302
+ - added initial version of the package for Python 3.9+ and torch 2.3.1+
@@ -0,0 +1,9 @@
1
+ torch
2
+ torchaudio
3
+ torchvision
4
+ numpy
5
+ wandb
6
+ gpustat
7
+ timm
8
+ einops
9
+ psutil
@@ -1,22 +1,22 @@
1
1
  [build-system]
2
- requires = ["setuptools", "wheel", "torch>=2.3.1"]
2
+ requires = ["setuptools", "wheel", "torch"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name='ista_daslab_optimizers'
7
- version='0.0.1'
7
+ version='1.0.1'
8
8
  dependencies = [
9
- "torch>=2.3.1",
10
- "torchaudio>=2.3.1",
11
- "torchvision>=0.18.1",
12
- "numpy>=1.24.1",
13
- "wandb>=0.17.1",
14
- "gpustat>=1.1.1",
15
- "timm>=1.0.3",
16
- "einops>=0.8.0",
17
- "psutil>=5.9.8",
9
+ "torch", # >=2.3.1",
10
+ "torchaudio", # >=2.3.1",
11
+ "torchvision", #>=0.18.1",
12
+ "numpy", # >=1.24.1",
13
+ "wandb",#>=0.17.1",
14
+ "gpustat",#>=1.1.1",
15
+ "timm", # >=1.0.3",
16
+ "einops", # >=0.7.0",
17
+ "psutil", # >=5.9.8",
18
18
  ]
19
- requires-python = '>= 3.9'
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.9",
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
- # CURRENT_PATH = os.environ['CURRENT_PATH']
6
- # kernels_dir = './kernels' # os.path.join(CURRENT_PATH, 'kernels')
7
- # cwd = os.getcwd()
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
- # print('-' * 100)
10
- # print(f'{kernels_dir=}')
11
- # print(f'{cwd=}')
12
- # print('-' * 100)
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
- ```
@@ -1,9 +0,0 @@
1
- torch>=2.3.1
2
- torchaudio>=2.3.1
3
- torchvision>=0.18.1
4
- numpy>=1.24.1
5
- wandb>=0.17.1
6
- gpustat>=1.1.1
7
- timm>=1.0.3
8
- einops>=0.8.0
9
- psutil>=5.9.8