bitsandbytes-cpu-fork 0.50.2.dev9__tar.gz → 0.50.2.dev11__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.
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/LICENSE +21 -21
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/MANIFEST.in +54 -35
- {bitsandbytes_cpu_fork-0.50.2.dev9/bitsandbytes_cpu_fork.egg-info → bitsandbytes_cpu_fork-0.50.2.dev11}/PKG-INFO +73 -11
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/README.md +72 -10
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/__init__.py +84 -84
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/__main__.py +4 -4
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/_cpu_caps.py +110 -110
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/_ops.py +526 -526
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/autograd/_functions.py +491 -491
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/cpu/ops.py +819 -819
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/cuda/ops.py +1212 -1212
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/default/ops.py +632 -632
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/hpu/ops.py +53 -53
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/mps/ops.py +277 -277
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/triton/kernels_4bit.py +583 -583
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/triton/kernels_8bit_quant.py +195 -195
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/triton/kernels_optim.py +1177 -1177
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/triton/ops.py +304 -304
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/utils.py +94 -94
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/xpu/ops.py +305 -305
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/cextension.py +447 -447
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/cli.py +50 -50
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/consts.py +12 -12
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/cuda_specs.py +111 -111
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/detect_cpu.py +189 -189
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/diagnostics/cuda.py +193 -193
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/diagnostics/main.py +134 -134
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/diagnostics/utils.py +12 -12
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/disk_balancer.py +1687 -1687
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/efst.py +782 -782
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/functional.py +1836 -1836
- bitsandbytes_cpu_fork-0.50.2.dev11/bitsandbytes/fused/__init__.py +21 -0
- bitsandbytes_cpu_fork-0.50.2.dev11/bitsandbytes/fused/_native.py +66 -0
- bitsandbytes_cpu_fork-0.50.2.dev11/bitsandbytes/fused/_ref.py +62 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/gdn_cpu.py +616 -616
- bitsandbytes_cpu_fork-0.50.2.dev11/bitsandbytes/libbitsandbytes_cpu.dll +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/nn/__init__.py +19 -19
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/nn/modules.py +1220 -1220
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/nn/parametrize.py +206 -206
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/__init__.py +26 -26
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/adagrad.py +187 -187
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/adam.py +346 -346
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/adamw.py +337 -337
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/adamw4bit.py +239 -239
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/ademamix.py +410 -410
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/lamb.py +190 -190
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/lars.py +259 -259
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/lion.py +266 -266
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/optimizer.py +756 -756
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/rmsprop.py +170 -170
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/optim/sgd.py +152 -152
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/q3bit.py +487 -481
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/torch_cpu_kit.py +794 -794
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/utils.py +208 -208
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes_cpu_cli.py +1062 -1062
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11/bitsandbytes_cpu_fork.egg-info}/PKG-INFO +73 -11
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes_cpu_fork.egg-info/SOURCES.txt +10 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/build_manual/build_manual.bat +234 -234
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/build_manual/export.def +44 -44
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/build_manual/export_generic.def +39 -39
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/build_manual/selftest_win.bat +37 -37
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/avx2_gemv_4bit.h +25 -3
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/common.cuh +105 -105
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/compat.cuh +206 -206
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/compat_device.cuh +51 -51
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/cpu_cache.h +160 -15
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/cpu_ops.cpp +114 -32
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit.cu +168 -168
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit_common.cuh +105 -105
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit_mma.cuh +125 -125
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit_simt.cu +547 -547
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit_simt.cuh +16 -16
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit_sm75.cu +416 -416
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit_sm75.cuh +16 -16
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit_sm80.cu +699 -699
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/gemm_4bit_sm80.cuh +16 -16
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/kernels.cu +1863 -1863
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/kernels.cuh +85 -85
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/ops.cu +602 -602
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/ops.cuh +151 -151
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/test_avx2_gemv_4bit.cpp +51 -4
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/test_cpu_cache.cpp +1 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/API_REFERENCE.md +17 -2
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/API_REFERENCE_EN.md +2 -2
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/ISA_MATRIX.md +2 -2
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/MOTION_BOUNDARY.md +3 -3
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/MOTION_BOUNDARY_EN.md +3 -3
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/QUICKSTART.md +111 -20
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/QUICKSTART_EN.md +126 -20
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/TECHNICAL_GUIDE.md +17 -15
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/TECHNICAL_GUIDE_EN.md +17 -15
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/TECH_REPORT.md +99 -8
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/TECH_REPORT_EN.md +117 -8
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/check_docs.py +180 -157
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/examples/compile_inference.py +32 -32
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/examples/cpu/cpu_training.py +370 -370
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/examples/int8_inference_huggingface.py +19 -19
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/examples/xpu/benchmark_paged_memory.py +253 -253
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/examples/xpu/paged_xpu_training.py +369 -369
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/pyproject.toml +124 -124
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/setup.py +175 -175
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_autograd.py +232 -232
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_cpu_e2e.py +201 -201
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_cuda_setup_evaluator.py +135 -135
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_functional.py +1049 -1049
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_generation.py +122 -122
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_linear4bit.py +614 -614
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_linear8bitlt.py +366 -366
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_modules.py +494 -494
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_ops.py +474 -474
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_optim.py +743 -743
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_parametrize.py +499 -499
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tests/test_rmsnorm_fwd_cpu.py +198 -198
- bitsandbytes_cpu_fork-0.50.2.dev11/tools/carve_selftest.py +225 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/create_github_release.ps1 +169 -169
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/dump_signatures.py +64 -64
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/gen_api_reference.py +43 -43
- bitsandbytes_cpu_fork-0.50.2.dev11/tools/mft_recover.c +148 -0
- bitsandbytes_cpu_fork-0.50.2.dev11/tools/mft_recover_gui.c +643 -0
- bitsandbytes_cpu_fork-0.50.2.dev11/tools/mft_recover_gui.manifest +37 -0
- bitsandbytes_cpu_fork-0.50.2.dev11/tools/mft_selftest.py +515 -0
- bitsandbytes_cpu_fork-0.50.2.dev11/tools/mftcore.h +690 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/patch_dev9.py +75 -75
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/publish.ps1 +99 -99
- bitsandbytes_cpu_fork-0.50.2.dev11/tools/recovery_pipeline_selftest.py +347 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/sector_carve.c +233 -15
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/sector_carve_gui.c +222 -16
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/sector_mirror.c +97 -2
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/sector_mirror_gui.c +318 -20
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/train_llm_sft.py +136 -111
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/verify_help_examples.py +213 -213
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/verify_train_release.py +90 -90
- bitsandbytes_cpu_fork-0.50.2.dev9/bitsandbytes/libbitsandbytes_cpu.dll +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/autograd/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/cpu/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/cuda/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/default/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/hpu/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/mps/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/triton/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/backends/xpu/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/diagnostics/__init__.py +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/py.typed +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/vcomp140.dll +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes_cpu_fork.egg-info/dependency_links.txt +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes_cpu_fork.egg-info/entry_points.txt +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes_cpu_fork.egg-info/requires.txt +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes_cpu_fork.egg-info/top_level.txt +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/build_linux.sh +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/build_manual/export_avx512.def +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/build_termux.sh +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/common.h +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/cpu_features.h +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/cpu_gdn.cpp +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/cpu_ops.h +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/pythonInterface.cpp +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/xpu_kernels.cpp +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/xpu_kernels.h +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/xpu_ops.cpp +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/csrc/xpu_ops.h +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/EPYC_VALIDATION.md +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/docs_cpu/WHEEL_PLATFORM_NOTES.md +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/selftest_cpu.c +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/setup.cfg +0 -0
- {bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/tools/verify_linux_cli.sh +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,35 +1,54 @@
|
|
|
1
|
-
# Files for the source distribution (sdist).
|
|
2
|
-
#
|
|
3
|
-
# The inherited manifest referenced the upstream CUDA layout:
|
|
4
|
-
# include CMakeLists.txt
|
|
5
|
-
# graft csrc
|
|
6
|
-
# graft include
|
|
7
|
-
# `include/` does not exist in this fork -- it held upstream's CUDA headers -- so
|
|
8
|
-
# every sdist build printed "no directories found matching 'include'", and
|
|
9
|
-
# CMakeLists.txt is unused now that the wheel ships a prebuilt CPU DLL instead of
|
|
10
|
-
# compiling anything.
|
|
11
|
-
#
|
|
12
|
-
# csrc is kept deliberately: it is what build_manual.bat / build_linux.sh /
|
|
13
|
-
# build_termux.sh compile when someone wants to rebuild the kernel themselves,
|
|
14
|
-
# which is the difference between an sdist that is merely installable and one that
|
|
15
|
-
# is actually useful.
|
|
16
|
-
graft csrc
|
|
17
|
-
graft build_manual
|
|
18
|
-
graft docs_cpu
|
|
19
|
-
graft examples
|
|
20
|
-
# tools/ holds gen_api_reference.py and verify_help_examples.py, which regenerate and
|
|
21
|
-
# check docs_cpu/API_REFERENCE*.md from the tables in bitsandbytes_cpu_cli.py. The
|
|
22
|
-
# generated documents ARE shipped, so leaving the generators out would hand users the
|
|
23
|
-
# output of scripts they cannot run.
|
|
24
|
-
graft tools
|
|
25
|
-
# ...but not the Windows binaries inside it. `graft tools` takes the whole directory,
|
|
26
|
-
# and the four sector_*.exe disaster-recovery tools were 0.65 MB of a 1.36 MB sdist --
|
|
27
|
-
# nearly half its weight, on every platform, for binaries that cannot run on two of the
|
|
28
|
-
# three. Their .c sources stay in the sdist and in the repository.
|
|
29
|
-
global-exclude *.exe
|
|
30
|
-
global-exclude *.exe.manifest
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
# Files for the source distribution (sdist).
|
|
2
|
+
#
|
|
3
|
+
# The inherited manifest referenced the upstream CUDA layout:
|
|
4
|
+
# include CMakeLists.txt
|
|
5
|
+
# graft csrc
|
|
6
|
+
# graft include
|
|
7
|
+
# `include/` does not exist in this fork -- it held upstream's CUDA headers -- so
|
|
8
|
+
# every sdist build printed "no directories found matching 'include'", and
|
|
9
|
+
# CMakeLists.txt is unused now that the wheel ships a prebuilt CPU DLL instead of
|
|
10
|
+
# compiling anything.
|
|
11
|
+
#
|
|
12
|
+
# csrc is kept deliberately: it is what build_manual.bat / build_linux.sh /
|
|
13
|
+
# build_termux.sh compile when someone wants to rebuild the kernel themselves,
|
|
14
|
+
# which is the difference between an sdist that is merely installable and one that
|
|
15
|
+
# is actually useful.
|
|
16
|
+
graft csrc
|
|
17
|
+
graft build_manual
|
|
18
|
+
graft docs_cpu
|
|
19
|
+
graft examples
|
|
20
|
+
# tools/ holds gen_api_reference.py and verify_help_examples.py, which regenerate and
|
|
21
|
+
# check docs_cpu/API_REFERENCE*.md from the tables in bitsandbytes_cpu_cli.py. The
|
|
22
|
+
# generated documents ARE shipped, so leaving the generators out would hand users the
|
|
23
|
+
# output of scripts they cannot run.
|
|
24
|
+
graft tools
|
|
25
|
+
# ...but not the Windows binaries inside it. `graft tools` takes the whole directory,
|
|
26
|
+
# and the four sector_*.exe disaster-recovery tools were 0.65 MB of a 1.36 MB sdist --
|
|
27
|
+
# nearly half its weight, on every platform, for binaries that cannot run on two of the
|
|
28
|
+
# three. Their .c sources stay in the sdist and in the repository.
|
|
29
|
+
global-exclude *.exe
|
|
30
|
+
global-exclude *.exe.manifest
|
|
31
|
+
# Not shipping byte-code: a stale __pycache__ inside csrc/ or tools/ can otherwise end up in the
|
|
32
|
+
# sdist, and a .pyc built by a different interpreter is worse than useless to the recipient
|
|
33
|
+
# (it is silently ignored, or it shadows nothing). The source is always there.
|
|
34
|
+
global-exclude *.pyc
|
|
35
|
+
global-exclude *.pyo
|
|
36
|
+
prune tools/__pycache__
|
|
37
|
+
# Build outputs are not sources. The tools/ directory holds compiled .obj files next to the .c
|
|
38
|
+
# they came from, and a local Linux build leaves libbitsandbytes_*.so in bitsandbytes/. A sdist
|
|
39
|
+
# built from such a tree carried 5.5 MB of them (a 4.1 MB AVX-512 .so among them) on every
|
|
40
|
+
# platform, because an egg-info SOURCES.txt written by that earlier build kept them listed.
|
|
41
|
+
# The Windows DLL stays: it is the prebuilt kernel this fork ships.
|
|
42
|
+
global-exclude *.obj
|
|
43
|
+
global-exclude *.pdb
|
|
44
|
+
global-exclude *.o
|
|
45
|
+
global-exclude *.a
|
|
46
|
+
global-exclude *.lib
|
|
47
|
+
global-exclude *.exp
|
|
48
|
+
global-exclude *.so
|
|
49
|
+
global-exclude *.dylib
|
|
50
|
+
include build_linux.sh
|
|
51
|
+
include build_termux.sh
|
|
52
|
+
include selftest_cpu.c
|
|
53
|
+
include README.md
|
|
54
|
+
include LICENSE
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bitsandbytes-cpu-fork
|
|
3
|
-
Version: 0.50.2.
|
|
3
|
+
Version: 0.50.2.dev11
|
|
4
4
|
Summary: bitsandbytes with a pure-CPU training backend (AVX2 / NEON): 8-bit optimizers, fused GDN, gemm_8bit, disk balancer. No GPU required.
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Project-URL: repository, https://github.com/Ganyvnanoaa09-0906/bitsandbytes-CPU
|
|
@@ -36,12 +36,12 @@ Dynamic: license-file
|
|
|
36
36
|
> toolkit and no driver** — just an AVX2 x86-64 CPU (or ARM64 NEON), the CPU build of PyTorch,
|
|
37
37
|
> and 12–16 GB of RAM.
|
|
38
38
|
|
|
39
|
-
**Version: `0.50.2.
|
|
39
|
+
**Version: `0.50.2.dev11`** · import name is unchanged (`import bitsandbytes as bnb`) · MIT.
|
|
40
40
|
|
|
41
41
|
What the CPU backend provides: 8-bit blockwise optimizers (≈2.3 bytes of state per parameter
|
|
42
42
|
instead of 8; the 4-bit optimizer ≈1.03), 4/8-bit layers that run on CPU tensors, the fused
|
|
43
43
|
Gated DeltaNet kernel for Qwen3-Next / Qwen3.5 linear attention, fused `gemm_8bit`, fused
|
|
44
|
-
RMSNorm/SwiGLU, an SSD cold-memory balancer, and a CPU training/concurrency toolbox.
|
|
44
|
+
RMSNorm/SwiGLU (with NT-store fast paths for large outputs), an SSD cold-memory balancer, and a CPU training/concurrency toolbox.
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
@@ -215,6 +215,48 @@ The library never loads a CUDA/ROCm/XPU library: `bnb.cuda`/`bnb.optim` CPU path
|
|
|
215
215
|
|
|
216
216
|
---
|
|
217
217
|
|
|
218
|
+
## Full fine-tuning vs LoRA
|
|
219
|
+
|
|
220
|
+
`--mode full` (and `bnb.optim.*` directly) fine-tunes **every parameter**; measured on
|
|
221
|
+
Qwen3.5-0.8B (752 M, 100% trainable, fp32 + AdamW8bit, seq 64, batch 1): **peak RSS
|
|
222
|
+
10.4 GB, 8.8 s/step**, versus LoRA (5.4 M trainable) at **5.9 GB / 2.65 s/step**. On a
|
|
223
|
+
15.4 GB machine ~0.8 B full fine-tuning is comfortable; ~1 B is tight (estimator:
|
|
224
|
+
10.7 GB weights+grads+8-bit state before activations), and above that use LoRA / EFST /
|
|
225
|
+
q3bit, or add activation checkpointing (not yet wired into the generic trainer).
|
|
226
|
+
|
|
227
|
+
## iGPU image inference (experimental)
|
|
228
|
+
|
|
229
|
+
The OpenCL kit is GEMM-oriented (`nn.Linear`/`Conv1D`); diffusion UNets are conv2d-heavy and
|
|
230
|
+
need an im2col+dGEMM conv engine before the OpenCL path can run them. As a proof of concept,
|
|
231
|
+
`gt1030/igpu_image_ort.py` runs an ONNX-exported SD1.5 through ONNX Runtime's
|
|
232
|
+
**DmlExecutionProvider** on the integrated GPU (local `_sd15_combined`, 256x256, DDIM):
|
|
233
|
+
|
|
234
|
+
| path | 8 steps | per step |
|
|
235
|
+
|---|---|---|
|
|
236
|
+
| CPU diffusers (Torch 2.13, 6 threads) | 25.29 s | 3.16 s |
|
|
237
|
+
| **iGPU ONNX Runtime DirectML** | **13.05 s** | **1.63 s** |
|
|
238
|
+
|
|
239
|
+
≈**1.9x** faster at 256x256; 512x512 currently fails inside the UNet on the DML EP (activation
|
|
240
|
+
memory / operator coverage) while the same ONNX runs on `CPUExecutionProvider`. Export once with
|
|
241
|
+
`optimum-cli export onnx --task stable-diffusion --opset 17`. A diffusers + `torch_directml`
|
|
242
|
+
variant (`igpu_image_infer.py`) is kept as a comparison; it needs legacy attention and still hits
|
|
243
|
+
DML `chunk`/reshape issues. Long-term the OpenCL backend gets an **fp16 device-resident conv engine**: measured probes
|
|
244
|
+
show per-op OpenCL conv is 2-3x slower than CPU oneDNN and fp32 resident only reaches parity,
|
|
245
|
+
but fp16 resident im2col+Hgemm is **1.3-2x faster than the CPU conv** at SD1.5 shapes
|
|
246
|
+
(538 vs 342 GFLOPS; 1280-channel 16x16 layer 17.3 vs 34.8 ms). The 256-resolution demo
|
|
247
|
+
therefore uses DirectML, while the OpenCL engine is the planned production backend.
|
|
248
|
+
|
|
249
|
+
The fp16 device-resident building blocks are in `gt1030/opencl_fp16_ops.py` +
|
|
250
|
+
`gt1030/kernels_attention.cl` (im2col + CLBlast Hgemm conv, GroupNorm+SiLU, LayerNorm,
|
|
251
|
+
GEGLU, multi-head attention, nearest-2x upsample, add). Clean measurements on the
|
|
252
|
+
Vega 6 (no CPU contention), parity 0.02-1.1% relL2:
|
|
253
|
+
ResNetBlock2D 0.61-0.77x, VAE up-block 0.40x, FFN 0.16-0.23x, attention 0.42-0.99x,
|
|
254
|
+
full Transformer block 0.51-0.71x of CPU time -- i.e. 1.3-6x faster for most blocks.
|
|
255
|
+
The **VAE decoder is now end-to-end on the iGPU** (`gt1030/opencl_vae.py`): fp16 parity
|
|
256
|
+
2.7-3.7% vs CPU, 1.81 s vs 2.07 s at 256 (0.87x), 7.93 s vs 8.34 s at 512 (0.95x, warm).
|
|
257
|
+
The remaining step is assembling the full 256px UNet graph (fp16 weights ~1.7 GB,
|
|
258
|
+
under the 5,090 MB single-allocation limit; 512px needs activation tiling).
|
|
259
|
+
|
|
218
260
|
## 3-bit frozen base + LoRA (`bitsandbytes.q3bit`, experimental)
|
|
219
261
|
|
|
220
262
|
A frozen weight can be stored as blockwise **3-bit** codes (≈11% of fp32 memory) and
|
|
@@ -257,6 +299,7 @@ R5-4500U (6C/6T, AVX2, 15.4 GB) / i5-10400 (6C/12T, AVX2, 12 GB), no NVIDIA GPU.
|
|
|
257
299
|
| Real model (Qwen3.5-0.8B LoRA, seq 64) | 4 threads beat 6 by **7–10%** — measure with `tune_threads()` |
|
|
258
300
|
| Fused lm_head 3-bit GEMM (research) | 14–22% faster than fp32 matmul, 89% less weight memory |
|
|
259
301
|
| 3-bit frozen base + LoRA (Qwen3-1.7B, CPU) | 80 steps: eval loss 4.34 → **4.03**; RSS **2.9 GB vs 8.7 GB** fp32; step 7.7 s vs 5.5 s (native Windows) |
|
|
302
|
+
| Full-parameter fine-tune (Qwen3.5-0.8B, 752 M, fp32 + AdamW8bit, CPU) | **10.4 GB peak RSS**, 8.8 s/step; LoRA on the same model: 5.9 GB, 2.65 s/step |
|
|
260
303
|
| AdamW4bit step (1M params) | 28.6 ms vs 3.3 ms for the AVX2 8-bit kernel; state 1.031 vs 2.062 B/param |
|
|
261
304
|
|
|
262
305
|
Not every workload is faster than fp32: 4-bit/8-bit kernels trade compute for memory traffic,
|
|
@@ -275,8 +318,8 @@ the full trade-off tables, including negative results.
|
|
|
275
318
|
- **manylinux_2_17 wheel**: the AVX-512 library inside it is single-threaded (the parallel
|
|
276
319
|
build is only for the native `manylinux_2_39` wheel). On AVX-512 machines set
|
|
277
320
|
`BNB_CPU_DISABLE_AVX512=1` to run the AVX2 OpenMP path.
|
|
278
|
-
- **aarch64**: there is no PyPI wheel yet; build from the sdist (`build_linux.sh`) or
|
|
279
|
-
Termux
|
|
321
|
+
- **aarch64**: there is no PyPI wheel yet; build from the sdist (`build_linux.sh`) or follow the
|
|
322
|
+
Termux guide [`TERMUX_GUIDE.md`](https://github.com/Ganyvnanoaa09-0906/bitsandbytes-CPU/blob/HEAD/bitsandbytes/TERMUX_GUIDE.md).
|
|
280
323
|
- **macOS**: no wheel is published and the CPU backend is not tested there; the sdist build may
|
|
281
324
|
work with clang + OpenMP, but treat it as unsupported.
|
|
282
325
|
- 3-bit (and 2-bit dequant-only) is **experimental**: the API and kernels are covered
|
|
@@ -295,6 +338,23 @@ bash build_linux.sh --selftest # also build + run the torch-free C se
|
|
|
295
338
|
build_manual\build_manual.bat amd # run inside "x64 Native Tools Command Prompt"
|
|
296
339
|
```
|
|
297
340
|
|
|
341
|
+
### Termux (Android / ARM64)
|
|
342
|
+
|
|
343
|
+
On-device builds work; there is no aarch64 PyPI wheel, so build from the sdist:
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
pkg update && pkg install -y clang libomp make python
|
|
347
|
+
bash build_termux.sh # -> bitsandbytes/libbitsandbytes_cpu.so
|
|
348
|
+
bash build_termux.sh --selftest # also build + run the torch-free C self-test
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Three Termux-specific traps the script already handles: the compiler is `clang++` (there is no
|
|
352
|
+
`g++`), OpenMP needs `pkg install libomp`, and `-march=native` is unsafe under Android's clang.
|
|
353
|
+
The script is also what the automated flow uses to build on a phone **driven from a PC over ADB**
|
|
354
|
+
— see [`TERMUX_GUIDE.md`](https://github.com/Ganyvnanoaa09-0906/bitsandbytes-CPU/blob/HEAD/bitsandbytes/TERMUX_GUIDE.md)
|
|
355
|
+
for the phone-side preparation, the ADB/wireless-debugging path, the ARM64 kernel notes and the
|
|
356
|
+
verification matrix.
|
|
357
|
+
|
|
298
358
|
Two special wheel builds used by this project are documented in
|
|
299
359
|
[`docs_cpu/WHEEL_PLATFORM_NOTES.md`](https://github.com/Ganyvnanoaa09-0906/bitsandbytes-CPU/blob/HEAD/bitsandbytes/docs_cpu/WHEEL_PLATFORM_NOTES.md):
|
|
300
360
|
the zig manylinux_2_17 portable build and the devtoolset-8 manylinux_2_17 **OpenMP** build
|
|
@@ -305,12 +365,12 @@ the zig manylinux_2_17 portable build and the devtoolset-8 manylinux_2_17 **Open
|
|
|
305
365
|
```bash
|
|
306
366
|
bash build_linux.sh --selftest # C kernels: 9 checks (quantize/gemm_8bit/gemv_4bit/
|
|
307
367
|
# AdamW8bit/vector-vs-scalar/2-3bit dequant/fused GEMM)
|
|
308
|
-
python test_efst_regressions.py # EFST: nested blocks, 3-D tensor experts, routing usage
|
|
309
|
-
python test_q3bit_kernels.py # 2/3-bit research prototype (old DLL-based tests)
|
|
310
|
-
python test_q3bit_api.py # public q3bit API: pack/dequant/gemm, QuantLinear3bit, fallback
|
|
311
|
-
python test_adamw4bit.py # restored 4-bit optimizer: state bytes, native vs torch, fp32 tracking
|
|
312
|
-
python test_concurrency_plan.py # planner / memory estimate / tune_threads / launcher
|
|
313
|
-
python test_disk_balancer_safety.py # data-safety rules for the disk balancer
|
|
368
|
+
python scripts/test/test_efst_regressions.py # EFST: nested blocks, 3-D tensor experts, routing usage
|
|
369
|
+
python scripts/test/test_q3bit_kernels.py # 2/3-bit research prototype (old DLL-based tests)
|
|
370
|
+
python scripts/test/test_q3bit_api.py # public q3bit API: pack/dequant/gemm, QuantLinear3bit, fallback
|
|
371
|
+
python scripts/test/test_adamw4bit.py # restored 4-bit optimizer: state bytes, native vs torch, fp32 tracking
|
|
372
|
+
python scripts/test/test_concurrency_plan.py # planner / memory estimate / tune_threads / launcher
|
|
373
|
+
python scripts/test/test_disk_balancer_safety.py # data-safety rules for the disk balancer
|
|
314
374
|
```
|
|
315
375
|
|
|
316
376
|
## Documentation
|
|
@@ -337,6 +397,8 @@ The long-form docs live in the repository (`bitsandbytes/docs_cpu/`, Chinese and
|
|
|
337
397
|
| `0.50.2.dev7` | documentation release: README rewritten for the CPU fork (install/wheels/platform matrix, feature table, measured performance, limitations, tests, full dev1→dev7 changelog, EFST/disk-balancer/toolbox examples) |
|
|
338
398
|
| `0.50.2.dev8` | **restored `AdamW4bit`** (the kernel was dropped when dev4 vendored upstream; now scalar C kernel + torch fallback, 1.031 B/param); **new `bitsandbytes.q3bit` API** — `quantize_3bit`/`dequantize_3bit`/`gemm_3bit`/`gemm_3bit_transposed`, `QuantLinear3bit` (frozen 3-bit base + LoRA), `convert_linears_3bit`, native kernels on Linux with identical pure-torch fallback; CLI reference now includes 4bitopt/q3bit and all 43 examples execute in CI-style verification |
|
|
339
399
|
| `0.50.2.dev9` | **Windows native kernels**: CI now compiles the MSVC DLL from the current csrc and the export list includes the 4-bit optimizer and 2/3-bit symbols (they were silently missing before); **q3bit real-model validation** on Qwen3-1.7B (frozen 3-bit base + LoRA, eval 4.34→4.03 over 80 steps, RSS −67%, native step 7.7 s vs fp32 5.5 s); fixed the causal-LM **double-shift** label bug in the iGPU training kit (Windows package v0.1.2) |
|
|
400
|
+
| `0.50.2.dev10` | **NTFS recovery toolkit** (`sector_carve`, `mft_recover`, CLI + GUI, selftests) and the **video E2E pipeline** (generation/training, LCM and motion diagnostics); AVX2 4-bit GEMV fixes (wrong FP4 codebook, lazy-init race, non-divisible blocksize); gt1030 probe scripts and docs |
|
|
401
|
+
| `0.50.2.dev11` | **NT-store fast paths**: 4-bit dequant writes bypass the cache above 16 MiB (1.7–2.0× at 32–64 MB) and RMSNorm chooses NT by total footprint (x+res+out vs per-CCX L3); CPUID L3-sharing mask fix and the NT threshold wired to one macro; **byte-reproducible sdist** with an identity gate that audits the uploaded bytes (`--sdist`, 2-DLL policy, 20 adversarial cases) plus a docs gate requiring all six ZH/EN docs; repo regrouping into `scripts/*`; UTF-8 BOM strip; 5 reproducible CPU audio benches; 6 video perf fixes and 3 AR fixes |
|
|
340
402
|
|
|
341
403
|
## License and attribution
|
|
342
404
|
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
> toolkit and no driver** — just an AVX2 x86-64 CPU (or ARM64 NEON), the CPU build of PyTorch,
|
|
6
6
|
> and 12–16 GB of RAM.
|
|
7
7
|
|
|
8
|
-
**Version: `0.50.2.
|
|
8
|
+
**Version: `0.50.2.dev11`** · import name is unchanged (`import bitsandbytes as bnb`) · MIT.
|
|
9
9
|
|
|
10
10
|
What the CPU backend provides: 8-bit blockwise optimizers (≈2.3 bytes of state per parameter
|
|
11
11
|
instead of 8; the 4-bit optimizer ≈1.03), 4/8-bit layers that run on CPU tensors, the fused
|
|
12
12
|
Gated DeltaNet kernel for Qwen3-Next / Qwen3.5 linear attention, fused `gemm_8bit`, fused
|
|
13
|
-
RMSNorm/SwiGLU, an SSD cold-memory balancer, and a CPU training/concurrency toolbox.
|
|
13
|
+
RMSNorm/SwiGLU (with NT-store fast paths for large outputs), an SSD cold-memory balancer, and a CPU training/concurrency toolbox.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -184,6 +184,48 @@ The library never loads a CUDA/ROCm/XPU library: `bnb.cuda`/`bnb.optim` CPU path
|
|
|
184
184
|
|
|
185
185
|
---
|
|
186
186
|
|
|
187
|
+
## Full fine-tuning vs LoRA
|
|
188
|
+
|
|
189
|
+
`--mode full` (and `bnb.optim.*` directly) fine-tunes **every parameter**; measured on
|
|
190
|
+
Qwen3.5-0.8B (752 M, 100% trainable, fp32 + AdamW8bit, seq 64, batch 1): **peak RSS
|
|
191
|
+
10.4 GB, 8.8 s/step**, versus LoRA (5.4 M trainable) at **5.9 GB / 2.65 s/step**. On a
|
|
192
|
+
15.4 GB machine ~0.8 B full fine-tuning is comfortable; ~1 B is tight (estimator:
|
|
193
|
+
10.7 GB weights+grads+8-bit state before activations), and above that use LoRA / EFST /
|
|
194
|
+
q3bit, or add activation checkpointing (not yet wired into the generic trainer).
|
|
195
|
+
|
|
196
|
+
## iGPU image inference (experimental)
|
|
197
|
+
|
|
198
|
+
The OpenCL kit is GEMM-oriented (`nn.Linear`/`Conv1D`); diffusion UNets are conv2d-heavy and
|
|
199
|
+
need an im2col+dGEMM conv engine before the OpenCL path can run them. As a proof of concept,
|
|
200
|
+
`gt1030/igpu_image_ort.py` runs an ONNX-exported SD1.5 through ONNX Runtime's
|
|
201
|
+
**DmlExecutionProvider** on the integrated GPU (local `_sd15_combined`, 256x256, DDIM):
|
|
202
|
+
|
|
203
|
+
| path | 8 steps | per step |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| CPU diffusers (Torch 2.13, 6 threads) | 25.29 s | 3.16 s |
|
|
206
|
+
| **iGPU ONNX Runtime DirectML** | **13.05 s** | **1.63 s** |
|
|
207
|
+
|
|
208
|
+
≈**1.9x** faster at 256x256; 512x512 currently fails inside the UNet on the DML EP (activation
|
|
209
|
+
memory / operator coverage) while the same ONNX runs on `CPUExecutionProvider`. Export once with
|
|
210
|
+
`optimum-cli export onnx --task stable-diffusion --opset 17`. A diffusers + `torch_directml`
|
|
211
|
+
variant (`igpu_image_infer.py`) is kept as a comparison; it needs legacy attention and still hits
|
|
212
|
+
DML `chunk`/reshape issues. Long-term the OpenCL backend gets an **fp16 device-resident conv engine**: measured probes
|
|
213
|
+
show per-op OpenCL conv is 2-3x slower than CPU oneDNN and fp32 resident only reaches parity,
|
|
214
|
+
but fp16 resident im2col+Hgemm is **1.3-2x faster than the CPU conv** at SD1.5 shapes
|
|
215
|
+
(538 vs 342 GFLOPS; 1280-channel 16x16 layer 17.3 vs 34.8 ms). The 256-resolution demo
|
|
216
|
+
therefore uses DirectML, while the OpenCL engine is the planned production backend.
|
|
217
|
+
|
|
218
|
+
The fp16 device-resident building blocks are in `gt1030/opencl_fp16_ops.py` +
|
|
219
|
+
`gt1030/kernels_attention.cl` (im2col + CLBlast Hgemm conv, GroupNorm+SiLU, LayerNorm,
|
|
220
|
+
GEGLU, multi-head attention, nearest-2x upsample, add). Clean measurements on the
|
|
221
|
+
Vega 6 (no CPU contention), parity 0.02-1.1% relL2:
|
|
222
|
+
ResNetBlock2D 0.61-0.77x, VAE up-block 0.40x, FFN 0.16-0.23x, attention 0.42-0.99x,
|
|
223
|
+
full Transformer block 0.51-0.71x of CPU time -- i.e. 1.3-6x faster for most blocks.
|
|
224
|
+
The **VAE decoder is now end-to-end on the iGPU** (`gt1030/opencl_vae.py`): fp16 parity
|
|
225
|
+
2.7-3.7% vs CPU, 1.81 s vs 2.07 s at 256 (0.87x), 7.93 s vs 8.34 s at 512 (0.95x, warm).
|
|
226
|
+
The remaining step is assembling the full 256px UNet graph (fp16 weights ~1.7 GB,
|
|
227
|
+
under the 5,090 MB single-allocation limit; 512px needs activation tiling).
|
|
228
|
+
|
|
187
229
|
## 3-bit frozen base + LoRA (`bitsandbytes.q3bit`, experimental)
|
|
188
230
|
|
|
189
231
|
A frozen weight can be stored as blockwise **3-bit** codes (≈11% of fp32 memory) and
|
|
@@ -226,6 +268,7 @@ R5-4500U (6C/6T, AVX2, 15.4 GB) / i5-10400 (6C/12T, AVX2, 12 GB), no NVIDIA GPU.
|
|
|
226
268
|
| Real model (Qwen3.5-0.8B LoRA, seq 64) | 4 threads beat 6 by **7–10%** — measure with `tune_threads()` |
|
|
227
269
|
| Fused lm_head 3-bit GEMM (research) | 14–22% faster than fp32 matmul, 89% less weight memory |
|
|
228
270
|
| 3-bit frozen base + LoRA (Qwen3-1.7B, CPU) | 80 steps: eval loss 4.34 → **4.03**; RSS **2.9 GB vs 8.7 GB** fp32; step 7.7 s vs 5.5 s (native Windows) |
|
|
271
|
+
| Full-parameter fine-tune (Qwen3.5-0.8B, 752 M, fp32 + AdamW8bit, CPU) | **10.4 GB peak RSS**, 8.8 s/step; LoRA on the same model: 5.9 GB, 2.65 s/step |
|
|
229
272
|
| AdamW4bit step (1M params) | 28.6 ms vs 3.3 ms for the AVX2 8-bit kernel; state 1.031 vs 2.062 B/param |
|
|
230
273
|
|
|
231
274
|
Not every workload is faster than fp32: 4-bit/8-bit kernels trade compute for memory traffic,
|
|
@@ -244,8 +287,8 @@ the full trade-off tables, including negative results.
|
|
|
244
287
|
- **manylinux_2_17 wheel**: the AVX-512 library inside it is single-threaded (the parallel
|
|
245
288
|
build is only for the native `manylinux_2_39` wheel). On AVX-512 machines set
|
|
246
289
|
`BNB_CPU_DISABLE_AVX512=1` to run the AVX2 OpenMP path.
|
|
247
|
-
- **aarch64**: there is no PyPI wheel yet; build from the sdist (`build_linux.sh`) or
|
|
248
|
-
Termux
|
|
290
|
+
- **aarch64**: there is no PyPI wheel yet; build from the sdist (`build_linux.sh`) or follow the
|
|
291
|
+
Termux guide [`TERMUX_GUIDE.md`](https://github.com/Ganyvnanoaa09-0906/bitsandbytes-CPU/blob/HEAD/bitsandbytes/TERMUX_GUIDE.md).
|
|
249
292
|
- **macOS**: no wheel is published and the CPU backend is not tested there; the sdist build may
|
|
250
293
|
work with clang + OpenMP, but treat it as unsupported.
|
|
251
294
|
- 3-bit (and 2-bit dequant-only) is **experimental**: the API and kernels are covered
|
|
@@ -264,6 +307,23 @@ bash build_linux.sh --selftest # also build + run the torch-free C se
|
|
|
264
307
|
build_manual\build_manual.bat amd # run inside "x64 Native Tools Command Prompt"
|
|
265
308
|
```
|
|
266
309
|
|
|
310
|
+
### Termux (Android / ARM64)
|
|
311
|
+
|
|
312
|
+
On-device builds work; there is no aarch64 PyPI wheel, so build from the sdist:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
pkg update && pkg install -y clang libomp make python
|
|
316
|
+
bash build_termux.sh # -> bitsandbytes/libbitsandbytes_cpu.so
|
|
317
|
+
bash build_termux.sh --selftest # also build + run the torch-free C self-test
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Three Termux-specific traps the script already handles: the compiler is `clang++` (there is no
|
|
321
|
+
`g++`), OpenMP needs `pkg install libomp`, and `-march=native` is unsafe under Android's clang.
|
|
322
|
+
The script is also what the automated flow uses to build on a phone **driven from a PC over ADB**
|
|
323
|
+
— see [`TERMUX_GUIDE.md`](https://github.com/Ganyvnanoaa09-0906/bitsandbytes-CPU/blob/HEAD/bitsandbytes/TERMUX_GUIDE.md)
|
|
324
|
+
for the phone-side preparation, the ADB/wireless-debugging path, the ARM64 kernel notes and the
|
|
325
|
+
verification matrix.
|
|
326
|
+
|
|
267
327
|
Two special wheel builds used by this project are documented in
|
|
268
328
|
[`docs_cpu/WHEEL_PLATFORM_NOTES.md`](https://github.com/Ganyvnanoaa09-0906/bitsandbytes-CPU/blob/HEAD/bitsandbytes/docs_cpu/WHEEL_PLATFORM_NOTES.md):
|
|
269
329
|
the zig manylinux_2_17 portable build and the devtoolset-8 manylinux_2_17 **OpenMP** build
|
|
@@ -274,12 +334,12 @@ the zig manylinux_2_17 portable build and the devtoolset-8 manylinux_2_17 **Open
|
|
|
274
334
|
```bash
|
|
275
335
|
bash build_linux.sh --selftest # C kernels: 9 checks (quantize/gemm_8bit/gemv_4bit/
|
|
276
336
|
# AdamW8bit/vector-vs-scalar/2-3bit dequant/fused GEMM)
|
|
277
|
-
python test_efst_regressions.py # EFST: nested blocks, 3-D tensor experts, routing usage
|
|
278
|
-
python test_q3bit_kernels.py # 2/3-bit research prototype (old DLL-based tests)
|
|
279
|
-
python test_q3bit_api.py # public q3bit API: pack/dequant/gemm, QuantLinear3bit, fallback
|
|
280
|
-
python test_adamw4bit.py # restored 4-bit optimizer: state bytes, native vs torch, fp32 tracking
|
|
281
|
-
python test_concurrency_plan.py # planner / memory estimate / tune_threads / launcher
|
|
282
|
-
python test_disk_balancer_safety.py # data-safety rules for the disk balancer
|
|
337
|
+
python scripts/test/test_efst_regressions.py # EFST: nested blocks, 3-D tensor experts, routing usage
|
|
338
|
+
python scripts/test/test_q3bit_kernels.py # 2/3-bit research prototype (old DLL-based tests)
|
|
339
|
+
python scripts/test/test_q3bit_api.py # public q3bit API: pack/dequant/gemm, QuantLinear3bit, fallback
|
|
340
|
+
python scripts/test/test_adamw4bit.py # restored 4-bit optimizer: state bytes, native vs torch, fp32 tracking
|
|
341
|
+
python scripts/test/test_concurrency_plan.py # planner / memory estimate / tune_threads / launcher
|
|
342
|
+
python scripts/test/test_disk_balancer_safety.py # data-safety rules for the disk balancer
|
|
283
343
|
```
|
|
284
344
|
|
|
285
345
|
## Documentation
|
|
@@ -306,6 +366,8 @@ The long-form docs live in the repository (`bitsandbytes/docs_cpu/`, Chinese and
|
|
|
306
366
|
| `0.50.2.dev7` | documentation release: README rewritten for the CPU fork (install/wheels/platform matrix, feature table, measured performance, limitations, tests, full dev1→dev7 changelog, EFST/disk-balancer/toolbox examples) |
|
|
307
367
|
| `0.50.2.dev8` | **restored `AdamW4bit`** (the kernel was dropped when dev4 vendored upstream; now scalar C kernel + torch fallback, 1.031 B/param); **new `bitsandbytes.q3bit` API** — `quantize_3bit`/`dequantize_3bit`/`gemm_3bit`/`gemm_3bit_transposed`, `QuantLinear3bit` (frozen 3-bit base + LoRA), `convert_linears_3bit`, native kernels on Linux with identical pure-torch fallback; CLI reference now includes 4bitopt/q3bit and all 43 examples execute in CI-style verification |
|
|
308
368
|
| `0.50.2.dev9` | **Windows native kernels**: CI now compiles the MSVC DLL from the current csrc and the export list includes the 4-bit optimizer and 2/3-bit symbols (they were silently missing before); **q3bit real-model validation** on Qwen3-1.7B (frozen 3-bit base + LoRA, eval 4.34→4.03 over 80 steps, RSS −67%, native step 7.7 s vs fp32 5.5 s); fixed the causal-LM **double-shift** label bug in the iGPU training kit (Windows package v0.1.2) |
|
|
369
|
+
| `0.50.2.dev10` | **NTFS recovery toolkit** (`sector_carve`, `mft_recover`, CLI + GUI, selftests) and the **video E2E pipeline** (generation/training, LCM and motion diagnostics); AVX2 4-bit GEMV fixes (wrong FP4 codebook, lazy-init race, non-divisible blocksize); gt1030 probe scripts and docs |
|
|
370
|
+
| `0.50.2.dev11` | **NT-store fast paths**: 4-bit dequant writes bypass the cache above 16 MiB (1.7–2.0× at 32–64 MB) and RMSNorm chooses NT by total footprint (x+res+out vs per-CCX L3); CPUID L3-sharing mask fix and the NT threshold wired to one macro; **byte-reproducible sdist** with an identity gate that audits the uploaded bytes (`--sdist`, 2-DLL policy, 20 adversarial cases) plus a docs gate requiring all six ZH/EN docs; repo regrouping into `scripts/*`; UTF-8 BOM strip; 5 reproducible CPU audio benches; 6 video perf fixes and 3 AR fixes |
|
|
309
371
|
|
|
310
372
|
## License and attribution
|
|
311
373
|
|
{bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/__init__.py
RENAMED
|
@@ -1,84 +1,84 @@
|
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
import importlib
|
|
8
|
-
import sys
|
|
9
|
-
|
|
10
|
-
import torch
|
|
11
|
-
|
|
12
|
-
from . import _ops, utils
|
|
13
|
-
from .autograd._functions import (
|
|
14
|
-
MatmulLtState,
|
|
15
|
-
matmul,
|
|
16
|
-
matmul_4bit,
|
|
17
|
-
)
|
|
18
|
-
from .backends.cpu import ops as cpu_ops
|
|
19
|
-
from .backends.default import ops as default_ops
|
|
20
|
-
from .nn import modules
|
|
21
|
-
from .optim import adam
|
|
22
|
-
|
|
23
|
-
# This is a signal for integrations with transformers/diffusers.
|
|
24
|
-
# Eventually we may remove this but it is currently required for compatibility.
|
|
25
|
-
features = {"multi_backend"}
|
|
26
|
-
supported_torch_devices = {
|
|
27
|
-
"cpu",
|
|
28
|
-
"cuda", # NVIDIA/AMD GPU
|
|
29
|
-
"xpu", # Intel GPU
|
|
30
|
-
"hpu", # Intel Gaudi
|
|
31
|
-
"npu", # Ascend NPU
|
|
32
|
-
"mps", # Apple Silicon
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if torch.cuda.is_available():
|
|
36
|
-
from .backends.cuda import ops as cuda_ops
|
|
37
|
-
|
|
38
|
-
if hasattr(torch, "xpu") and torch.xpu.is_available():
|
|
39
|
-
from .backends.xpu import ops as xpu_ops
|
|
40
|
-
|
|
41
|
-
if hasattr(torch.backends, "mps") and torch.backends.mps.is_available():
|
|
42
|
-
from .backends.mps import ops as mps_ops
|
|
43
|
-
|
|
44
|
-
if importlib.util.find_spec("habana_frameworks") and importlib.util.find_spec("habana_frameworks.torch"):
|
|
45
|
-
# In case not automatically imported
|
|
46
|
-
import habana_frameworks.torch
|
|
47
|
-
|
|
48
|
-
if hasattr(torch, "hpu") and torch.hpu.is_available():
|
|
49
|
-
from .backends.hpu import ops as hpu_ops
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def _import_backends():
|
|
53
|
-
"""
|
|
54
|
-
Discover and autoload all available backends installed as separate packages.
|
|
55
|
-
Packages with an entrypoint for "bitsandbytes.backends" will be loaded.
|
|
56
|
-
Inspired by PyTorch implementation: https://pytorch.org/tutorials/prototype/python_extension_autoload.html
|
|
57
|
-
"""
|
|
58
|
-
from importlib.metadata import entry_points
|
|
59
|
-
|
|
60
|
-
extensions = entry_points(group="bitsandbytes.backends")
|
|
61
|
-
|
|
62
|
-
for ext in extensions:
|
|
63
|
-
try:
|
|
64
|
-
entry = ext.load()
|
|
65
|
-
entry()
|
|
66
|
-
except Exception as e:
|
|
67
|
-
raise RuntimeError(f"bitsandbytes: failed to load backend {ext.name}: {e}") from e
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
_import_backends()
|
|
71
|
-
|
|
72
|
-
__pdoc__ = {
|
|
73
|
-
"libbitsandbytes": False,
|
|
74
|
-
"optim.optimizer.Optimizer8bit": False,
|
|
75
|
-
"optim.optimizer.MockArgs": False,
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
__version__ = "0.50.2.
|
|
79
|
-
|
|
80
|
-
# 挂载 gdn_cpu(GDN 融合内核 / patch_transformers 入口),让 bnb.gdn_cpu 可直接访问
|
|
81
|
-
from . import gdn_cpu # noqa: E402,F401
|
|
82
|
-
|
|
83
|
-
# 挂载 q3bit(实验性 2/3-bit 量化 / 冻结 3-bit base + LoRA),让 bnb.q3bit 可直接访问
|
|
84
|
-
from . import q3bit # noqa: E402,F401
|
|
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
|
+
|
|
6
|
+
|
|
7
|
+
import importlib
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
import torch
|
|
11
|
+
|
|
12
|
+
from . import _ops, utils
|
|
13
|
+
from .autograd._functions import (
|
|
14
|
+
MatmulLtState,
|
|
15
|
+
matmul,
|
|
16
|
+
matmul_4bit,
|
|
17
|
+
)
|
|
18
|
+
from .backends.cpu import ops as cpu_ops
|
|
19
|
+
from .backends.default import ops as default_ops
|
|
20
|
+
from .nn import modules
|
|
21
|
+
from .optim import adam
|
|
22
|
+
|
|
23
|
+
# This is a signal for integrations with transformers/diffusers.
|
|
24
|
+
# Eventually we may remove this but it is currently required for compatibility.
|
|
25
|
+
features = {"multi_backend"}
|
|
26
|
+
supported_torch_devices = {
|
|
27
|
+
"cpu",
|
|
28
|
+
"cuda", # NVIDIA/AMD GPU
|
|
29
|
+
"xpu", # Intel GPU
|
|
30
|
+
"hpu", # Intel Gaudi
|
|
31
|
+
"npu", # Ascend NPU
|
|
32
|
+
"mps", # Apple Silicon
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if torch.cuda.is_available():
|
|
36
|
+
from .backends.cuda import ops as cuda_ops
|
|
37
|
+
|
|
38
|
+
if hasattr(torch, "xpu") and torch.xpu.is_available():
|
|
39
|
+
from .backends.xpu import ops as xpu_ops
|
|
40
|
+
|
|
41
|
+
if hasattr(torch.backends, "mps") and torch.backends.mps.is_available():
|
|
42
|
+
from .backends.mps import ops as mps_ops
|
|
43
|
+
|
|
44
|
+
if importlib.util.find_spec("habana_frameworks") and importlib.util.find_spec("habana_frameworks.torch"):
|
|
45
|
+
# In case not automatically imported
|
|
46
|
+
import habana_frameworks.torch
|
|
47
|
+
|
|
48
|
+
if hasattr(torch, "hpu") and torch.hpu.is_available():
|
|
49
|
+
from .backends.hpu import ops as hpu_ops
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _import_backends():
|
|
53
|
+
"""
|
|
54
|
+
Discover and autoload all available backends installed as separate packages.
|
|
55
|
+
Packages with an entrypoint for "bitsandbytes.backends" will be loaded.
|
|
56
|
+
Inspired by PyTorch implementation: https://pytorch.org/tutorials/prototype/python_extension_autoload.html
|
|
57
|
+
"""
|
|
58
|
+
from importlib.metadata import entry_points
|
|
59
|
+
|
|
60
|
+
extensions = entry_points(group="bitsandbytes.backends")
|
|
61
|
+
|
|
62
|
+
for ext in extensions:
|
|
63
|
+
try:
|
|
64
|
+
entry = ext.load()
|
|
65
|
+
entry()
|
|
66
|
+
except Exception as e:
|
|
67
|
+
raise RuntimeError(f"bitsandbytes: failed to load backend {ext.name}: {e}") from e
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
_import_backends()
|
|
71
|
+
|
|
72
|
+
__pdoc__ = {
|
|
73
|
+
"libbitsandbytes": False,
|
|
74
|
+
"optim.optimizer.Optimizer8bit": False,
|
|
75
|
+
"optim.optimizer.MockArgs": False,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
__version__ = "0.50.2.dev11"
|
|
79
|
+
|
|
80
|
+
# 挂载 gdn_cpu(GDN 融合内核 / patch_transformers 入口),让 bnb.gdn_cpu 可直接访问
|
|
81
|
+
from . import gdn_cpu # noqa: E402,F401
|
|
82
|
+
|
|
83
|
+
# 挂载 q3bit(实验性 2/3-bit 量化 / 冻结 3-bit base + LoRA),让 bnb.q3bit 可直接访问
|
|
84
|
+
from . import q3bit # noqa: E402,F401
|
{bitsandbytes_cpu_fork-0.50.2.dev9 → bitsandbytes_cpu_fork-0.50.2.dev11}/bitsandbytes/__main__.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
if __name__ == "__main__":
|
|
2
|
-
from bitsandbytes.diagnostics.main import main
|
|
3
|
-
|
|
4
|
-
main()
|
|
1
|
+
if __name__ == "__main__":
|
|
2
|
+
from bitsandbytes.diagnostics.main import main
|
|
3
|
+
|
|
4
|
+
main()
|