Skip to content

Commit d5cb0f2

Browse files
Remove unused kernels (#1880)
1 parent c27dc58 commit d5cb0f2

File tree

12 files changed

+5
-1611
lines changed

12 files changed

+5
-1611
lines changed

agents/api_surface.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ bitsandbytes.optim.optimizer.Optimizer8bit(params, defaults, optim_bits=32, is_p
390390
bitsandbytes.optim.optimizer.Optimizer2State(
391391
optimizer_name, params, lr=1e-3, betas=(0.9, 0.999),
392392
eps=1e-8, weight_decay=0.0, optim_bits=32, args=None,
393-
min_8bit_size=4096, percentile_clipping=100,
394-
block_wise=True, max_unorm=0.0, skip_zeros=False,
393+
min_8bit_size=4096, max_unorm=0.0, skip_zeros=False,
395394
is_paged=False, alpha=0.0, t_alpha=None, t_beta3=None,
396395
)
397396
```
@@ -405,8 +404,7 @@ bitsandbytes.optim.optimizer.Optimizer2State(
405404
bitsandbytes.optim.optimizer.Optimizer1State(
406405
optimizer_name, params, lr=1e-3, betas=(0.9, 0.0),
407406
eps=1e-8, weight_decay=0.0, optim_bits=32, args=None,
408-
min_8bit_size=4096, percentile_clipping=100,
409-
block_wise=True, max_unorm=0.0, skip_zeros=False,
407+
min_8bit_size=4096, max_unorm=0.0, skip_zeros=False,
410408
is_paged=False,
411409
)
412410
```
@@ -532,8 +530,6 @@ All bnb optimizers share these parameters beyond the standard PyTorch ones:
532530
|-----------|------|---------|-------------|
533531
| `optim_bits` | `int` | 32 | 32 for full precision state, 8 for quantized state |
534532
| `min_8bit_size` | `int` | 4096 | Parameters smaller than this use 32-bit state even in 8-bit mode |
535-
| `percentile_clipping` | `int` | 100 | Gradient clipping at a percentile. 100 = disabled |
536-
| `block_wise` | `bool` | `True` | Block-wise quantization of optimizer states (vs global) |
537533
| `max_unorm` | `float` | 0.0 | Maximum update norm relative to weight norm. 0 = disabled |
538534
| `skip_zeros` | `bool` | `False` | Skip zero gradients in sparse models |
539535
| `is_paged` | `bool` | `False` | Use CUDA managed memory for state offloading |
@@ -1313,7 +1309,6 @@ removed in a future release.
13131309
| `quantize_no_absmax` | `functional` | `quantize_blockwise` |
13141310
| `dequantize_no_absmax` | `functional` | `dequantize_blockwise` |
13151311
| `optimizer_update_8bit` | `functional` | `optimizer_update_8bit_blockwise` |
1316-
| `percentile_clipping` | `functional` | N/A (still used internally by non-blockwise path) |
13171312

13181313
---
13191314

agents/architecture_guide.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ All ops are defined with the namespace `bitsandbytes::`:
231231
**Optimizer ops:**
232232
- `optimizer_update_32bit` — 32-bit optimizer step (Adam, Lion, SGD, etc.)
233233
- `optimizer_update_8bit_blockwise` — 8-bit blockwise optimizer step
234-
- `optimizer_update_8bit` — 8-bit non-blockwise optimizer step (legacy)
235-
236-
**Utility ops:**
237-
- `percentile_clipping` — adaptive gradient clipping by percentile
238234

239235
---
240236

@@ -745,10 +741,8 @@ The base class `Optimizer2State.update_step()` then dispatches based on state dt
745741
def update_step(self, group, p, gindex, pindex):
746742
if state["state1"].dtype == torch.float:
747743
F.optimizer_update_32bit(self.optimizer_name, grad, p, state1, ...)
748-
elif state["state1"].dtype == torch.uint8 and config["block_wise"]:
744+
elif state["state1"].dtype == torch.uint8:
749745
F.optimizer_update_8bit_blockwise(self.optimizer_name, grad, p, state1, ...)
750-
elif state["state1"].dtype == torch.uint8 and not config["block_wise"]:
751-
F.optimizer_update_8bit(self.optimizer_name, grad, p, state1, ...)
752746
```
753747

754748
### Optimizer state initialization
@@ -1080,7 +1074,7 @@ Optimizer8bit.step():
10801074
├── p.data = p.data.contiguous()
10811075
├── config = self.get_config(gindex, pindex, group)
10821076
1083-
├── state["state1"].dtype == uint8 and block_wise:
1077+
├── state["state1"].dtype == uint8:
10841078
│ F.optimizer_update_8bit_blockwise("adam", grad, p, state1, state2,
10851079
│ beta1, beta2, ..., qmap1, qmap2, absmax1, absmax2, ...)
10861080
│ ↓

agents/security_guide.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ bitsandbytes/autograd/_functions.py:
445445
```
446446
bitsandbytes/functional.py:
447447
- optimizer_update_8bit_blockwise() — 8-bit optimizer step
448-
- percentile_clipping() — gradient clipping for optimizer stability
449448
450449
csrc/ops.cu / kernels.cu:
451450
- Optimizer kernel implementations

0 commit comments

Comments
 (0)