installation-diagnostics
Diagnose and fix bitsandbytes installation, import, backend compatibility, native-library loading, and source-build issues.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- installation-diagnostics
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Diagnose and fix bitsandbytes installation, import, backend compatibility, native-library loading, and source-build issues.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/backend-compatibility.md7.2 KB
- 参考文档references/source-builds.md6.2 KB
- 参考文档references/troubleshooting.md8.0 KB
- 脚本scripts/backend-report.py9.5 KB
03 SKILL.md 正文
Installation Diagnostics
Use this sub-skill when a task involves installing bitsandbytes, debugging import bitsandbytes, checking CPU/CUDA/ROCm/XPU/HPU/MPS support, interpreting python -m bitsandbytes, choosing a source build, resolving native library load failures, or preparing sanitized environment details for an issue.
Route Here When
- Installation or import fails, or native methods fail after import.
- A user asks whether their Python, PyTorch, CUDA, ROCm, XPU, Gaudi, MPS, CPU, OS, or wheel combination is supported.
- Errors mention
libbitsandbytes_cpu,libbitsandbytes_cuda*,libbitsandbytes_rocm*,libcudart,amdhip64,fatbinwrap,no kernel image,Configured CUDA binary not found, or CPU-only native methods. - The environment uses
BNB_CUDA_VERSIONorBNB_ROCM_VERSION, or the selected binary does not match PyTorch's reported accelerator runtime. - The user is in CPU-only CI and needs import/signature/package inspection without GPU kernels.
- The user needs source-build decisions for CUDA, ROCm, CPU, XPU, MPS, Jetson/aarch64, Windows, or macOS.
Do Not Handle Here
- Hugging Face
BitsAndBytesConfig, QLoRA, PEFT, Accelerate, Diffusers, or model-loading choices: route to../transformers-integrations/SKILL.md. - Direct
bitsandbytes.nn,bitsandbytes.functional, quantized layer, state dict, or primitive API usage: route to../quantized-modules-functions/SKILL.md. - Optimizer selection,
GlobalOptimManager, training-loop integration, or paged optimizer usage: route to../optimizers-training/SKILL.md.
First Response Workflow
- Ask for the exact command, traceback, OS/architecture, Python version, PyTorch version, and whether the user expects CPU, CUDA, ROCm, XPU, HPU, or MPS.
- Prefer read-only checks first:
python -m bitsandbytes,python -c "import torch; print(torch.__version__, torch.version.cuda, torch.version.hip, torch.cuda.is_available())", andpython scripts/backend-report.py --jsonfrom this sub-skill when available. - Compare PyTorch's reported runtime (
torch.version.cudaortorch.version.hip) plus anyBNB_*_VERSIONoverride against the bundledlibbitsandbytes_*filenames. - Separate import/package inspection from accelerator execution: CPU-only environments can validate imports and signatures but cannot prove CUDA/ROCm/XPU kernels work.
- Use
references/backend-compatibility.mdfor support matrices and expected binaries,references/source-builds.mdfor safe build choices, andreferences/troubleshooting.mdfor symptom-to-fix guidance.
Safe Commands
python -m bitsandbytes
python sub-skills/installation-diagnostics/scripts/backend-report.py --help
python sub-skills/installation-diagnostics/scripts/backend-report.py --json
python -c "import bitsandbytes, torch; print(bitsandbytes.__version__, torch.__version__)"
Avoid running GPU optimizer or quantized model smoke tests unless the user confirms accelerator hardware is available and they want kernel execution. Avoid installer scripts that download or mutate CUDA/ROCm; distill their intent into source-build guidance instead.
Issue Info Checklist
Collect only sanitized details: OS and architecture, Python/PyTorch/bitsandbytes versions, torch.version.cuda or torch.version.hip, torch.cuda.is_available(), visible device names if the user agrees, BNB_CUDA_VERSION/BNB_ROCM_VERSION values, expected/bundled native library names, the minimal traceback, and whether the install came from a wheel or source build. Do not include access tokens, usernames, full home paths, private project paths, or complete environment dumps.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).