Skip to content

Commit fb3ea19

Browse files
github-actions[bot]jiqing-fengpnunna93matthewdouglasTitus-von-Koeller
authored
Automated PR: Downstream develop rebase new changes (#5)
* check grad before using ipex (bitsandbytes-foundation#1358) * Enable packaging for ROCm 6.2 (bitsandbytes-foundation#1367) * Enable 6.2 build * Update documentation for 6.2.0 pip install * Update for VS2022 17.11 compatibility with CUDA < 12.4 (bitsandbytes-foundation#1341) * Update for VS2022 17.11 compatibility with CUDA < 12.4 * Try again * Enable continuous releases for multi-backend-refactor branch * Update release workflow * Publish continuous release for multi-backend * continuous release: revert wheel renaming due to install err * Revert "continuous release: revert wheel renaming due to install err" This reverts commit 0a2b539. * add dynamic tag-based versioning + git hash for dev vers * docs: update w/ changes from `main` * get tags for dynamic versioning * fine-tune continuous release params * reduce the pkg size + build times for the preview release * refine docs for multi-backend alpha release (bitsandbytes-foundation#1380) * refine docs for multi-backend alpha release * docs: further tweaks to multi-backend alpha docs * docs: further tweaks to multi-backend alpha docs * docs: further tweaks to multi-backend alpha docs * docs: add multi-backend feedback links * docs: add request for contributions * docs: small fixes * docs: small fixes * docs: add info about `main` continuous build * docs: further tweaks to multi-backend alpha docs * docs: further tweaks to multi-backend alpha docs * docs: remove 2 obsolete lines * Remove depth option in installation steps (bitsandbytes-foundation#1395) * Add build job for rocm * Add rocm build script * Copy shared obj file into output_dir * upload build artifacts and enable wheels build * Remove cuda build temporarily * Add ROCm version to .so filename * Add rocm_version to whls build * Revert "Remove cuda build temporarily" This reverts commit 1413c5f. * Add rocm_version env var * Remove thrush header files * Print node info * print cuda node info * Revert "print cuda node info" This reverts commit cdb209a. * Revert "Print node info" This reverts commit 7e9a65c. * Add rocm arch to compile command * Rename .so files to rocm * Update default gpu arch * Skip cpu based igemmlt int tests on ROCm * Update Documentation * Update upstream repo name * Update docs * Update string format Co-authored-by: Aarni Koskela <[email protected]> * Remove pre-release option for torch install * Update pytorch install path Co-authored-by: Titus <[email protected]> * Add messages for Heuristics error * Remove toolcache for disk space * print disk usage * Clean disk space for linux * Fix for ubuntu * Add sudo for apt clean * Update clean up disk list * remove disk usage print * Add BNB_BACKEND variable * Update diagnostic functions for ROCm * Fix tuple error * Fix library detection bug for recursive and symlink cases * fix pre-commit errors * Remove recursive path lib search * Create function for runtime lib patterns * Update logger format Co-authored-by: Aarni Koskela <[email protected]> * Update error reporting Co-authored-by: Aarni Koskela <[email protected]> * Remove commented code Co-authored-by: Aarni Koskela <[email protected]> * Update error reporting Co-authored-by: Aarni Koskela <[email protected]> * Update error reporting * Create hip diagnostics functions * Fix Typo * Fix pre-commit checks * Enable 6.2 build * Skip gemv 4 bit cpu test * Update documentation for 6.2.0 pip install * Update README for default branch change * Fix typo * Sync README with upstream * Remove depth --------- Co-authored-by: Aarni Koskela <[email protected]> Co-authored-by: Titus <[email protected]> Co-authored-by: Aswin John Mathews <[email protected]> Co-authored-by: root <[email protected]> * sync instructions --------- Co-authored-by: jiqing-feng <[email protected]> Co-authored-by: pnunna93 <[email protected]> Co-authored-by: Matthew Douglas <[email protected]> Co-authored-by: Titus von Koeller <[email protected]> Co-authored-by: Aarni Koskela <[email protected]> Co-authored-by: Aswin John Mathews <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 4aad810 commit fb3ea19

File tree

9 files changed

+294
-54
lines changed

9 files changed

+294
-54
lines changed

.github/workflows/python-package.yml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
# This job matrix builds the CUDA versions of the libraries for platforms that support CUDA (Linux x64/aarch64 + Windows x64)
5959
##
6060
build-shared-libs-cuda:
61+
if: github.ref_name != 'multi-backend-refactor'
6162
strategy:
6263
matrix:
6364
os: [ubuntu-latest, windows-latest]
@@ -148,7 +149,7 @@ jobs:
148149
build-wheels:
149150
needs:
150151
- build-shared-libs
151-
- build-shared-libs-cuda
152+
# - build-shared-libs-cuda reduce the pkg size + build times for the preview release
152153
- build-shared-libs-rocm
153154
strategy:
154155
matrix:
@@ -166,6 +167,13 @@ jobs:
166167
runs-on: ${{ matrix.os }}
167168
steps:
168169
- uses: actions/checkout@v4
170+
with:
171+
fetch-depth: 1 # shallow clone
172+
- name: Fetch tags for dynamic versioning in setup.py
173+
run: |
174+
git fetch --depth=1 origin --tags
175+
echo "Available Git tags:"
176+
git tag -n
169177
- name: Download build artifact
170178
uses: actions/download-artifact@v4
171179
with:
@@ -183,7 +191,8 @@ jobs:
183191
python-version: ${{ matrix.python-version }}
184192
cache: pip
185193
- run: pip install build wheel
186-
- run: python -m build .
194+
# for now need to do the below instead of prior `python -m build .`, which didn't allow us to access git tags
195+
- run: python -m build --sdist && python -m build --wheel
187196
- name: Determine and Set Platform Tag, then Tag Wheel
188197
shell: bash
189198
run: |
@@ -197,6 +206,45 @@ jobs:
197206
path: dist/bitsandbytes-*.whl
198207
retention-days: 7
199208

209+
upload-pre-release-wheels:
210+
name: Create release and upload artifacts
211+
runs-on: ubuntu-latest
212+
if: github.ref_name == 'multi-backend-refactor'
213+
permissions:
214+
contents: write
215+
needs:
216+
- build-wheels
217+
steps:
218+
- name: Download and rename artifacts
219+
uses: actions/download-artifact@v4
220+
with:
221+
path: tmp/
222+
pattern: "bdist_wheel_*"
223+
merge-multiple: true
224+
- name: Inspect tmp directory after downloading artifacts
225+
run: ls -alFR tmp/
226+
- name: Move and rename wheel files with pattern replacement
227+
run: |
228+
mkdir -p wheels/
229+
find tmp/ -type f -name '*.whl' -print0 | while IFS= read -r -d '' wheel; do
230+
wheel_filename=$(basename "$wheel")
231+
# Remove the gith hash, e.g. `+1234567`, for a stable download link on the multi-backend pre-release
232+
cleaned_filename=$(echo "$wheel_filename" | sed -E 's/\+[0-9a-f]{7}-/-/g')
233+
mv "$wheel" "wheels/$cleaned_filename"
234+
done
235+
- name: Inspect wheels directory after renaming files
236+
run: ls -alFR wheels/
237+
- name: Create release and upload artifacts
238+
uses: softprops/[email protected]
239+
with:
240+
files: wheels/*.whl
241+
prerelease: true
242+
name: Multi-Backend Preview
243+
tag_name: continuous-release_multi-backend-refactor
244+
make_latest: false
245+
draft: false
246+
target_commitish: ${{ github.sha }}
247+
200248
audit-wheels:
201249
needs: build-wheels
202250
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ dmypy.json
151151
# vim
152152
*.swp
153153

154+
# BNB-specific stuff
154155
dependencies
155156
cuda_build
156157
output/
158+
bitsandbytes/_version.py

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ if(BUILD_CUDA)
8282
# This needs to be added *before* we try to enable the CUDA language so CMake's compiler check passes.
8383
if(MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL 1940)
8484
string(APPEND CMAKE_CUDA_FLAGS " --allow-unsupported-compiler")
85+
86+
# This is needed to build with VS2022 17.11+ and CUDA < 12.4.
87+
if (MSVC_VERSION VERSION_GREATER_EQUAL 1941)
88+
string(APPEND CMAKE_CUDA_FLAGS " -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH")
89+
endif()
8590
endif()
8691

8792
enable_language(CUDA) # This will fail if CUDA is not found

bitsandbytes/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# This source code is licensed under the MIT license found in the
44
# LICENSE file in the root directory of this source tree.
55

6+
# Import the dynamically generated version from _version.py (see setup.py)
7+
from ._version import __version__ # isort: skip # type: ignore
8+
69
import torch
710

811
from . import research, utils
@@ -73,5 +76,3 @@
7376
"optim.optimizer.Optimizer8bit": False,
7477
"optim.optimizer.MockArgs": False,
7578
}
76-
77-
__version__ = "0.43.3.dev"

bitsandbytes/nn/modules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ def forward(self, x: torch.Tensor):
471471
and not hasattr(self.weight.quant_state, "op_context")
472472
and self.weight.quant_state.shape[1] % self.weight.quant_state.blocksize == 0
473473
and self.weight.quant_state.quant_type == "nf4"
474+
and x.requires_grad == False
474475
):
475476
enable_ipex_fusion(self.weight, self.weight.quant_state)
476477

docs/source/contributing.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
### Setup pre-commit hooks
77
- Install pre-commit hooks with `pip install pre-commit`.
8-
- Run `pre-commit autoupdate` once to configure the hooks.
9-
- Re-run `pre-commit autoupdate` every time a new hook got added.
8+
- Run `pre-commit install` once to install the hooks, so they will be run on every commit.
9+
- If the hooks introduce changes, they'll be visible with `git diff`. Review them and `git add` them if everything is fine, then re-execute the before commit, it should pass now.
10+
- If you want to manually trigger the hooks, you may do `pre-commit run --all-files`
1011

1112
Now all the pre-commit hooks will be automatically run when you try to commit and if they introduce some changes, you need to re-add the changed files before being able to commit and push.
1213

0 commit comments

Comments
 (0)