Skip to content

Commit

Permalink
Merge branch 'main' into saurav/configs
Browse files Browse the repository at this point in the history
  • Loading branch information
SauravMaheshkar authored Oct 9, 2024
2 parents b1d94fb + 723e216 commit b52a3c2
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 80 deletions.
41 changes: 16 additions & 25 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,45 +162,36 @@ jobs:
needs:
- build-wheels
steps:
- name: Download artifacts to tmp directory
- name: Download and rename artifacts
uses: actions/download-artifact@v4
with:
path: tmp/
pattern: "bdist_wheel_*"
merge-multiple: true
- name: Inspect tmp directory after downloading artifacts
run: ls -alFR tmp/
- name: Move and rename wheel files
- name: Move and rename wheel files with pattern replacement
run: |
mkdir -p wheels/
find tmp/ -type f -name '*.whl' -print0 | while IFS= read -r -d '' wheel; do
# exclude macos wheels for now
find tmp/ -type f -name '*.whl' ! -name '*macos*' -print0 | while IFS= read -r -d '' wheel; do
wheel_filename=$(basename "$wheel")
if [[ $wheel_filename == *linux*x86_64* ]]; then
mv "$wheel" wheels/bnb-linux-x86_64.whl
elif [[ $wheel_filename == *linux*aarch64* ]]; then
mv "$wheel" wheels/bnb-linux-aarch64.whl
elif [[ $wheel_filename == *macosx*x86_64* ]]; then
mv "$wheel" wheels/bnb-macos-x86_64.whl
elif [[ $wheel_filename == *macosx*arm64* ]]; then
mv "$wheel" wheels/bnb-macos-arm64.whl
elif [[ $wheel_filename == *win*amd64* ]]; then
mv "$wheel" wheels/bnb-windows-x86_64.whl
else
echo "Unknown wheel format: $wheel_filename"
exit 1
fi
# Remove the gith hash, e.g. `+1234567`, for a stable download link on the multi-backend pre-release
cleaned_filename=$(echo "$wheel_filename" | sed -E 's/\+[0-9a-f]{7}-/-/g')
mv "$wheel" "wheels/$cleaned_filename"
done
- name: Inspect wheels directory after renaming files
run: ls -alFR wheels/
- name: Create release and upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTINUOUS_RELEASE_TYPE: prerelease
GITHUB_CONTINUOUS_RELEASE_TAG: continuous-release_main
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage --appimage-extract-and-run wheels/*.whl
uses: softprops/[email protected]
with:
files: wheels/*.whl
prerelease: true
name: Latest `main` wheel
tag_name: continuous-release_main
make_latest: false
draft: false
target_commitish: ${{ github.sha }}

audit-wheels:
needs: build-wheels
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ There are ongoing efforts to support further hardware backends, i.e. Intel CPU +

**[https://huggingface.co/docs/bitsandbytes/main](https://huggingface.co/docs/bitsandbytes/main)**

## ALPHA TESTERS WANTED: `multi-backend-refactor` AMD GPU + Intel CPU/GPU specific BNB backend implementations
## `𝗯𝗶𝘁𝘀𝗮𝗻𝗱𝗯𝘆𝘁𝗲𝘀` 𝗺𝘂𝗹𝘁𝗶-𝗯𝗮𝗰𝗸𝗲𝗻𝗱 𝙖𝙡𝙥𝙝𝙖 𝗿𝗲𝗹𝗲𝗮𝘀𝗲 is out!

We're in the process of a complex refactor in order to allow the support of additional hardware backends, other than CUDA, in BNB. The efforts around this are already quite far along and there's plenty of functionality already in place that is in need for users to take a hands-on approach! Mac support will likely soon also see progress. However, I recommend waiting 2 weeks until the device abstraction has further consolidated (**breaking changes upcoming**).
🚀 Big news! After months of hard work and incredible community contributions, we're thrilled to announce the 𝗯𝗶𝘁𝘀𝗮𝗻𝗱𝗯𝘆𝘁𝗲𝘀 𝗺𝘂𝗹𝘁𝗶-𝗯𝗮𝗰𝗸𝗲𝗻𝗱 𝙖𝙡𝙥𝙝𝙖 𝗿𝗲𝗹𝗲𝗮𝘀𝗲! 💥

Currently, you still need to compile from source, after checking out the `multi-backend-refactor` branch (instructions WIP, but [the current docs on the compilation from source](https://huggingface.co/docs/bitsandbytes/main/en/installation#compile-from-source) are a good starting point; [feel free to share tips / input in this Github discussion](https://github.com/TimDettmers/bitsandbytes/discussions/1219). We'll soon enable nightly releases to make this much easier for you!
Now supporting:
- 🔥 𝗔𝗠𝗗 𝗚𝗣𝗨𝘀 (ROCm)
- ⚡ 𝗜𝗻𝘁𝗲𝗹 𝗖𝗣𝗨𝘀 & 𝗚𝗣𝗨𝘀

Please give feedback to us in [this dedicated Github Discussion space](https://github.com/TimDettmers/bitsandbytes/discussions/categories/catch-all-alpha-testing-the-multi-backend-refactor)!
We’d love your early feedback! 🙏

We're super excited about these recent developments and grateful for any constructive input or support that you can give to help us make this a reality. BNB is a community project and we're excited for your collaboration 🤗
👉 [Instructions for your `𝚙𝚒𝚙 𝚒𝚗𝚜𝚝𝚊𝚕𝚕` here](https://huggingface.co/docs/bitsandbytes/main/en/installation#multi-backend)

We're super excited about these recent developments and grateful for any constructive input or support that you can give to help us make this a reality (e.g. helping us with the upcoming Apple Silicon backend or reporting bugs). BNB is a community project and we're excited for your collaboration 🤗

## License

Expand Down
2 changes: 1 addition & 1 deletion bitsandbytes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"optim.optimizer.MockArgs": False,
}

__version__ = "0.44.1.dev"
__version__ = "0.44.2.dev"
5 changes: 2 additions & 3 deletions bitsandbytes/optim/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def load_state_dict(self, state_dict, move_to_device=True):
raise ValueError("loaded state dict has a different number of parameter groups")
param_lens = (len(g["params"]) for g in groups)
saved_lens = (len(g["params"]) for g in saved_groups)
if any(p_len != s_len for p_len, s_len in zip(param_lens, saved_lens, strict=True)):
if any(p_len != s_len for p_len, s_len in zip(param_lens, saved_lens)):
raise ValueError(
"loaded state dict contains a parameter group that doesn't match the size of optimizer's group",
)
Expand All @@ -184,7 +184,6 @@ def load_state_dict(self, state_dict, move_to_device=True):
for old_id, p in zip(
chain.from_iterable(g["params"] for g in saved_groups),
chain.from_iterable(g["params"] for g in groups),
strict=True,
)
}

Expand Down Expand Up @@ -226,7 +225,7 @@ def update_group(group, new_group):
new_group["params"] = group["params"]
return new_group

param_groups = [update_group(g, ng) for g, ng in zip(groups, saved_groups, strict=True)]
param_groups = [update_group(g, ng) for g, ng in zip(groups, saved_groups)]
self.__setstate__({"state": state, "param_groups": param_groups})

def to_gpu(self):
Expand Down
Loading

0 comments on commit b52a3c2

Please sign in to comment.