bitsandbytes-cpu-fork 0.50.2.dev2__py3-none-win_amd64.whl → 0.50.2.dev4__py3-none-win_amd64.whl

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 (54) hide show
  1. bitsandbytes/__init__.py +1 -1
  2. bitsandbytes/__main__.py +4 -4
  3. bitsandbytes/_cpu_caps.py +110 -0
  4. bitsandbytes/_ops.py +526 -526
  5. bitsandbytes/autograd/_functions.py +491 -491
  6. bitsandbytes/backends/cpu/ops.py +805 -805
  7. bitsandbytes/backends/cuda/ops.py +1212 -1212
  8. bitsandbytes/backends/default/ops.py +632 -632
  9. bitsandbytes/backends/hpu/ops.py +53 -53
  10. bitsandbytes/backends/mps/ops.py +277 -277
  11. bitsandbytes/backends/triton/kernels_4bit.py +583 -577
  12. bitsandbytes/backends/triton/kernels_8bit_quant.py +195 -195
  13. bitsandbytes/backends/triton/kernels_optim.py +1177 -1177
  14. bitsandbytes/backends/triton/ops.py +304 -304
  15. bitsandbytes/backends/utils.py +94 -94
  16. bitsandbytes/backends/xpu/ops.py +305 -305
  17. bitsandbytes/cextension.py +447 -405
  18. bitsandbytes/cli.py +50 -50
  19. bitsandbytes/consts.py +12 -12
  20. bitsandbytes/cuda_specs.py +111 -111
  21. bitsandbytes/detect_cpu.py +189 -189
  22. bitsandbytes/diagnostics/cuda.py +193 -193
  23. bitsandbytes/diagnostics/main.py +134 -134
  24. bitsandbytes/diagnostics/utils.py +12 -12
  25. bitsandbytes/disk_balancer.py +1276 -1224
  26. bitsandbytes/efst.py +777 -0
  27. bitsandbytes/functional.py +1836 -1836
  28. bitsandbytes/gdn_cpu.py +616 -602
  29. bitsandbytes/libbitsandbytes_cpu.dll +0 -0
  30. bitsandbytes/nn/__init__.py +19 -19
  31. bitsandbytes/nn/modules.py +1220 -1220
  32. bitsandbytes/nn/parametrize.py +206 -206
  33. bitsandbytes/optim/__init__.py +0 -4
  34. bitsandbytes/optim/adagrad.py +187 -187
  35. bitsandbytes/optim/adam.py +346 -346
  36. bitsandbytes/optim/adamw.py +337 -337
  37. bitsandbytes/optim/ademamix.py +410 -410
  38. bitsandbytes/optim/lamb.py +190 -190
  39. bitsandbytes/optim/lars.py +259 -259
  40. bitsandbytes/optim/lion.py +266 -266
  41. bitsandbytes/optim/optimizer.py +756 -756
  42. bitsandbytes/optim/rmsprop.py +170 -170
  43. bitsandbytes/optim/sgd.py +152 -152
  44. bitsandbytes/torch_cpu_kit.py +468 -468
  45. bitsandbytes/utils.py +208 -208
  46. bitsandbytes_cpu_cli.py +1012 -949
  47. {bitsandbytes_cpu_fork-0.50.2.dev2.dist-info → bitsandbytes_cpu_fork-0.50.2.dev4.dist-info}/METADATA +12 -4
  48. bitsandbytes_cpu_fork-0.50.2.dev4.dist-info/RECORD +64 -0
  49. {bitsandbytes_cpu_fork-0.50.2.dev2.dist-info → bitsandbytes_cpu_fork-0.50.2.dev4.dist-info}/licenses/LICENSE +21 -21
  50. bitsandbytes/optim/adamw4bit.py +0 -183
  51. bitsandbytes_cpu_fork-0.50.2.dev2.dist-info/RECORD +0 -63
  52. {bitsandbytes_cpu_fork-0.50.2.dev2.dist-info → bitsandbytes_cpu_fork-0.50.2.dev4.dist-info}/WHEEL +0 -0
  53. {bitsandbytes_cpu_fork-0.50.2.dev2.dist-info → bitsandbytes_cpu_fork-0.50.2.dev4.dist-info}/entry_points.txt +0 -0
  54. {bitsandbytes_cpu_fork-0.50.2.dev2.dist-info → bitsandbytes_cpu_fork-0.50.2.dev4.dist-info}/top_level.txt +0 -0
@@ -1,266 +1,266 @@
1
- # Copyright (c) Facebook, Inc. and its affiliates.
2
- #
3
- # This source code is licensed under the MIT license found in the
4
- # LICENSE file in the root directory of this source tree.
5
- from bitsandbytes.optim.optimizer import Optimizer1State
6
-
7
-
8
- class Lion(Optimizer1State):
9
- def __init__(
10
- self,
11
- params,
12
- lr=1e-4,
13
- betas=(0.9, 0.99),
14
- weight_decay=0,
15
- optim_bits=32,
16
- args=None,
17
- min_8bit_size=4096,
18
- is_paged=False,
19
- ):
20
- """
21
- Base Lion optimizer.
22
-
23
- Arguments:
24
- params (`torch.tensor`):
25
- The input parameters to optimize.
26
- lr (`float`, defaults to 1e-4):
27
- The learning rate.
28
- betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
29
- The beta values are the decay rates of the first and second-order moment of the optimizer.
30
- weight_decay (`float`, defaults to 0):
31
- The weight decay value for the optimizer.
32
- optim_bits (`int`, defaults to 32):
33
- The number of bits of the optimizer state.
34
- args (`object`, defaults to `None`):
35
- An object with additional arguments.
36
- min_8bit_size (`int`, defaults to 4096):
37
- The minimum number of elements of the parameter tensors for 8-bit optimization.
38
- is_paged (`bool`, defaults to `False`):
39
- Whether the optimizer is a paged optimizer or not.
40
- """
41
- super().__init__(
42
- "lion",
43
- params,
44
- lr,
45
- betas,
46
- 0.0,
47
- weight_decay,
48
- optim_bits,
49
- args,
50
- min_8bit_size,
51
- is_paged=is_paged,
52
- )
53
-
54
-
55
- class Lion8bit(Optimizer1State):
56
- def __init__(
57
- self,
58
- params,
59
- lr=1e-4,
60
- betas=(0.9, 0.99),
61
- weight_decay=0,
62
- args=None,
63
- min_8bit_size=4096,
64
- is_paged=False,
65
- ):
66
- """
67
- 8-bit Lion optimizer.
68
-
69
- Arguments:
70
- params (`torch.tensor`):
71
- The input parameters to optimize.
72
- lr (`float`, defaults to 1e-4):
73
- The learning rate.
74
- betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
75
- The beta values are the decay rates of the first and second-order moment of the optimizer.
76
- weight_decay (`float`, defaults to 0):
77
- The weight decay value for the optimizer.
78
- args (`object`, defaults to `None`):
79
- An object with additional arguments.
80
- min_8bit_size (`int`, defaults to 4096):
81
- The minimum number of elements of the parameter tensors for 8-bit optimization.
82
- is_paged (`bool`, defaults to `False`):
83
- Whether the optimizer is a paged optimizer or not.
84
- """
85
- super().__init__(
86
- "lion",
87
- params,
88
- lr,
89
- betas,
90
- 0.0,
91
- weight_decay,
92
- 8,
93
- args,
94
- min_8bit_size,
95
- is_paged=is_paged,
96
- )
97
-
98
-
99
- class Lion32bit(Optimizer1State):
100
- def __init__(
101
- self,
102
- params,
103
- lr=1e-4,
104
- betas=(0.9, 0.99),
105
- weight_decay=0,
106
- args=None,
107
- min_8bit_size=4096,
108
- is_paged=False,
109
- ):
110
- """
111
- 32-bit Lion optimizer.
112
-
113
- Arguments:
114
- params (`torch.tensor`):
115
- The input parameters to optimize.
116
- lr (`float`, defaults to 1e-4):
117
- The learning rate.
118
- betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
119
- The beta values are the decay rates of the first and second-order moment of the optimizer.
120
- weight_decay (`float`, defaults to 0):
121
- The weight decay value for the optimizer.
122
- args (`object`, defaults to `None`):
123
- An object with additional arguments.
124
- min_8bit_size (`int`, defaults to 4096):
125
- The minimum number of elements of the parameter tensors for 8-bit optimization.
126
- is_paged (`bool`, defaults to `False`):
127
- Whether the optimizer is a paged optimizer or not.
128
- """
129
- super().__init__(
130
- "lion",
131
- params,
132
- lr,
133
- betas,
134
- 0.0,
135
- weight_decay,
136
- 32,
137
- args,
138
- min_8bit_size,
139
- is_paged=is_paged,
140
- )
141
-
142
-
143
- class PagedLion(Optimizer1State):
144
- def __init__(
145
- self,
146
- params,
147
- lr=1e-4,
148
- betas=(0.9, 0.99),
149
- weight_decay=0,
150
- optim_bits=32,
151
- args=None,
152
- min_8bit_size=4096,
153
- ):
154
- """
155
- Paged Lion optimizer.
156
-
157
- Arguments:
158
- params (`torch.tensor`):
159
- The input parameters to optimize.
160
- lr (`float`, defaults to 1e-4):
161
- The learning rate.
162
- betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
163
- The beta values are the decay rates of the first and second-order moment of the optimizer.
164
- weight_decay (`float`, defaults to 0):
165
- The weight decay value for the optimizer.
166
- optim_bits (`int`, defaults to 32):
167
- The number of bits of the optimizer state.
168
- args (`object`, defaults to `None`):
169
- An object with additional arguments.
170
- min_8bit_size (`int`, defaults to 4096):
171
- The minimum number of elements of the parameter tensors for 8-bit optimization.
172
- """
173
- super().__init__(
174
- "lion",
175
- params,
176
- lr,
177
- betas,
178
- 0.0,
179
- weight_decay,
180
- optim_bits,
181
- args,
182
- min_8bit_size,
183
- is_paged=True,
184
- )
185
-
186
-
187
- class PagedLion8bit(Optimizer1State):
188
- def __init__(
189
- self,
190
- params,
191
- lr=1e-4,
192
- betas=(0.9, 0.99),
193
- weight_decay=0,
194
- args=None,
195
- min_8bit_size=4096,
196
- ):
197
- """
198
- Paged 8-bit Lion optimizer.
199
-
200
- Arguments:
201
- params (`torch.tensor`):
202
- The input parameters to optimize.
203
- lr (`float`, defaults to 1e-4):
204
- The learning rate.
205
- betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
206
- The beta values are the decay rates of the first and second-order moment of the optimizer.
207
- weight_decay (`float`, defaults to 0):
208
- The weight decay value for the optimizer.
209
- args (`object`, defaults to `None`):
210
- An object with additional arguments.
211
- min_8bit_size (`int`, defaults to 4096):
212
- The minimum number of elements of the parameter tensors for 8-bit optimization.
213
- """
214
- super().__init__(
215
- "lion",
216
- params,
217
- lr,
218
- betas,
219
- 0.0,
220
- weight_decay,
221
- 8,
222
- args,
223
- min_8bit_size,
224
- is_paged=True,
225
- )
226
-
227
-
228
- class PagedLion32bit(Optimizer1State):
229
- def __init__(
230
- self,
231
- params,
232
- lr=1e-4,
233
- betas=(0.9, 0.99),
234
- weight_decay=0,
235
- args=None,
236
- min_8bit_size=4096,
237
- ):
238
- """
239
- Paged 32-bit Lion optimizer.
240
-
241
- Arguments:
242
- params (`torch.tensor`):
243
- The input parameters to optimize.
244
- lr (`float`, defaults to 1e-4):
245
- The learning rate.
246
- betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
247
- The beta values are the decay rates of the first and second-order moment of the optimizer.
248
- weight_decay (`float`, defaults to 0):
249
- The weight decay value for the optimizer.
250
- args (`object`, defaults to `None`):
251
- An object with additional arguments.
252
- min_8bit_size (`int`, defaults to 4096):
253
- The minimum number of elements of the parameter tensors for 8-bit optimization.
254
- """
255
- super().__init__(
256
- "lion",
257
- params,
258
- lr,
259
- betas,
260
- 0.0,
261
- weight_decay,
262
- 32,
263
- args,
264
- min_8bit_size,
265
- is_paged=True,
266
- )
1
+ # Copyright (c) Facebook, Inc. and its affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+ from bitsandbytes.optim.optimizer import Optimizer1State
6
+
7
+
8
+ class Lion(Optimizer1State):
9
+ def __init__(
10
+ self,
11
+ params,
12
+ lr=1e-4,
13
+ betas=(0.9, 0.99),
14
+ weight_decay=0,
15
+ optim_bits=32,
16
+ args=None,
17
+ min_8bit_size=4096,
18
+ is_paged=False,
19
+ ):
20
+ """
21
+ Base Lion optimizer.
22
+
23
+ Arguments:
24
+ params (`torch.tensor`):
25
+ The input parameters to optimize.
26
+ lr (`float`, defaults to 1e-4):
27
+ The learning rate.
28
+ betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
29
+ The beta values are the decay rates of the first and second-order moment of the optimizer.
30
+ weight_decay (`float`, defaults to 0):
31
+ The weight decay value for the optimizer.
32
+ optim_bits (`int`, defaults to 32):
33
+ The number of bits of the optimizer state.
34
+ args (`object`, defaults to `None`):
35
+ An object with additional arguments.
36
+ min_8bit_size (`int`, defaults to 4096):
37
+ The minimum number of elements of the parameter tensors for 8-bit optimization.
38
+ is_paged (`bool`, defaults to `False`):
39
+ Whether the optimizer is a paged optimizer or not.
40
+ """
41
+ super().__init__(
42
+ "lion",
43
+ params,
44
+ lr,
45
+ betas,
46
+ 0.0,
47
+ weight_decay,
48
+ optim_bits,
49
+ args,
50
+ min_8bit_size,
51
+ is_paged=is_paged,
52
+ )
53
+
54
+
55
+ class Lion8bit(Optimizer1State):
56
+ def __init__(
57
+ self,
58
+ params,
59
+ lr=1e-4,
60
+ betas=(0.9, 0.99),
61
+ weight_decay=0,
62
+ args=None,
63
+ min_8bit_size=4096,
64
+ is_paged=False,
65
+ ):
66
+ """
67
+ 8-bit Lion optimizer.
68
+
69
+ Arguments:
70
+ params (`torch.tensor`):
71
+ The input parameters to optimize.
72
+ lr (`float`, defaults to 1e-4):
73
+ The learning rate.
74
+ betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
75
+ The beta values are the decay rates of the first and second-order moment of the optimizer.
76
+ weight_decay (`float`, defaults to 0):
77
+ The weight decay value for the optimizer.
78
+ args (`object`, defaults to `None`):
79
+ An object with additional arguments.
80
+ min_8bit_size (`int`, defaults to 4096):
81
+ The minimum number of elements of the parameter tensors for 8-bit optimization.
82
+ is_paged (`bool`, defaults to `False`):
83
+ Whether the optimizer is a paged optimizer or not.
84
+ """
85
+ super().__init__(
86
+ "lion",
87
+ params,
88
+ lr,
89
+ betas,
90
+ 0.0,
91
+ weight_decay,
92
+ 8,
93
+ args,
94
+ min_8bit_size,
95
+ is_paged=is_paged,
96
+ )
97
+
98
+
99
+ class Lion32bit(Optimizer1State):
100
+ def __init__(
101
+ self,
102
+ params,
103
+ lr=1e-4,
104
+ betas=(0.9, 0.99),
105
+ weight_decay=0,
106
+ args=None,
107
+ min_8bit_size=4096,
108
+ is_paged=False,
109
+ ):
110
+ """
111
+ 32-bit Lion optimizer.
112
+
113
+ Arguments:
114
+ params (`torch.tensor`):
115
+ The input parameters to optimize.
116
+ lr (`float`, defaults to 1e-4):
117
+ The learning rate.
118
+ betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
119
+ The beta values are the decay rates of the first and second-order moment of the optimizer.
120
+ weight_decay (`float`, defaults to 0):
121
+ The weight decay value for the optimizer.
122
+ args (`object`, defaults to `None`):
123
+ An object with additional arguments.
124
+ min_8bit_size (`int`, defaults to 4096):
125
+ The minimum number of elements of the parameter tensors for 8-bit optimization.
126
+ is_paged (`bool`, defaults to `False`):
127
+ Whether the optimizer is a paged optimizer or not.
128
+ """
129
+ super().__init__(
130
+ "lion",
131
+ params,
132
+ lr,
133
+ betas,
134
+ 0.0,
135
+ weight_decay,
136
+ 32,
137
+ args,
138
+ min_8bit_size,
139
+ is_paged=is_paged,
140
+ )
141
+
142
+
143
+ class PagedLion(Optimizer1State):
144
+ def __init__(
145
+ self,
146
+ params,
147
+ lr=1e-4,
148
+ betas=(0.9, 0.99),
149
+ weight_decay=0,
150
+ optim_bits=32,
151
+ args=None,
152
+ min_8bit_size=4096,
153
+ ):
154
+ """
155
+ Paged Lion optimizer.
156
+
157
+ Arguments:
158
+ params (`torch.tensor`):
159
+ The input parameters to optimize.
160
+ lr (`float`, defaults to 1e-4):
161
+ The learning rate.
162
+ betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
163
+ The beta values are the decay rates of the first and second-order moment of the optimizer.
164
+ weight_decay (`float`, defaults to 0):
165
+ The weight decay value for the optimizer.
166
+ optim_bits (`int`, defaults to 32):
167
+ The number of bits of the optimizer state.
168
+ args (`object`, defaults to `None`):
169
+ An object with additional arguments.
170
+ min_8bit_size (`int`, defaults to 4096):
171
+ The minimum number of elements of the parameter tensors for 8-bit optimization.
172
+ """
173
+ super().__init__(
174
+ "lion",
175
+ params,
176
+ lr,
177
+ betas,
178
+ 0.0,
179
+ weight_decay,
180
+ optim_bits,
181
+ args,
182
+ min_8bit_size,
183
+ is_paged=True,
184
+ )
185
+
186
+
187
+ class PagedLion8bit(Optimizer1State):
188
+ def __init__(
189
+ self,
190
+ params,
191
+ lr=1e-4,
192
+ betas=(0.9, 0.99),
193
+ weight_decay=0,
194
+ args=None,
195
+ min_8bit_size=4096,
196
+ ):
197
+ """
198
+ Paged 8-bit Lion optimizer.
199
+
200
+ Arguments:
201
+ params (`torch.tensor`):
202
+ The input parameters to optimize.
203
+ lr (`float`, defaults to 1e-4):
204
+ The learning rate.
205
+ betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
206
+ The beta values are the decay rates of the first and second-order moment of the optimizer.
207
+ weight_decay (`float`, defaults to 0):
208
+ The weight decay value for the optimizer.
209
+ args (`object`, defaults to `None`):
210
+ An object with additional arguments.
211
+ min_8bit_size (`int`, defaults to 4096):
212
+ The minimum number of elements of the parameter tensors for 8-bit optimization.
213
+ """
214
+ super().__init__(
215
+ "lion",
216
+ params,
217
+ lr,
218
+ betas,
219
+ 0.0,
220
+ weight_decay,
221
+ 8,
222
+ args,
223
+ min_8bit_size,
224
+ is_paged=True,
225
+ )
226
+
227
+
228
+ class PagedLion32bit(Optimizer1State):
229
+ def __init__(
230
+ self,
231
+ params,
232
+ lr=1e-4,
233
+ betas=(0.9, 0.99),
234
+ weight_decay=0,
235
+ args=None,
236
+ min_8bit_size=4096,
237
+ ):
238
+ """
239
+ Paged 32-bit Lion optimizer.
240
+
241
+ Arguments:
242
+ params (`torch.tensor`):
243
+ The input parameters to optimize.
244
+ lr (`float`, defaults to 1e-4):
245
+ The learning rate.
246
+ betas (`tuple(float, float)`, defaults to (0.9, 0.999)):
247
+ The beta values are the decay rates of the first and second-order moment of the optimizer.
248
+ weight_decay (`float`, defaults to 0):
249
+ The weight decay value for the optimizer.
250
+ args (`object`, defaults to `None`):
251
+ An object with additional arguments.
252
+ min_8bit_size (`int`, defaults to 4096):
253
+ The minimum number of elements of the parameter tensors for 8-bit optimization.
254
+ """
255
+ super().__init__(
256
+ "lion",
257
+ params,
258
+ lr,
259
+ betas,
260
+ 0.0,
261
+ weight_decay,
262
+ 32,
263
+ args,
264
+ min_8bit_size,
265
+ is_paged=True,
266
+ )