| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
PyTorch's _check_is_size is being removed in a future release per pytorch/pytorch#169400 ("Use _check(i >= 0) instead"). This replaces all 23 occurrences with the recommended torch._check pattern, matching the existing torch._check style already used elsewhere in these files. Affected files (23 occurrences): - bitsandbytes/_ops.py (8) - bitsandbytes/backends/triton/ops.py (5) - bitsandbytes/backends/default/ops.py (4) - bitsandbytes/backends/cpu/ops.py (3) - bitsandbytes/backends/cuda/ops.py (2) - bitsandbytes/backends/hpu/ops.py (1) torch._check is available in all torch >= 2.0; bitsandbytes requires torch >= 2.2 per pyproject.toml, so no backwards-compat shim is needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Sorry, something went wrong.
|
LGTM, thanks! |
Sorry, something went wrong.
|
you are most welcome. I'm very happy to be of service. I appreciate the excellent community support you've provided |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Closes #1933.
PyTorch's torch._check_is_size is being removed in a future release per pytorch/pytorch#169400 — the FutureWarning advises "Use _check(i >= 0) instead". This PR finds / replaces all older approach instances with the recommended substitution.
Scope
23 occurrences across 6 files:
Each call torch._check_is_size(blocksize) is replaced with the upstream-recommended pattern:
This matches the existing torch._check(...) style already used at adjacent lines in the same files.
Backwards compatibility
torch._check is available in all torch >= 2.0; bitsandbytes requires torch >= 2.2 per pyproject.toml. No backwards-compat shim needed.
Test plan
Additional audits
Audit structure adopted from @rapsealk's #1931 (asserts → exceptions refactor) for similar mechanical-substitution PRs.
Semantic equivalence under SymInt (FakeTensor / torch.compile)
_check_is_size(i) does two things: (1) asserts i >= 0, and (2) informs PyTorch's dynamic-shape engine that i is a size (i.e., non-negative). The substitution _check(blocksize >= 0, ...) preserves both behaviors:
This matches the upstream migration explicitly recommended in pytorch/pytorch#169400 ("Use _check(i >= 0) instead").
Out of scope