forked from bitsandbytes-foundation/bitsandbytes
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into IFU-master-2024-03-28
- Loading branch information
Showing
136 changed files
with
7,332 additions
and
3,541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[*] | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ran black and isort for coherent code formatting | ||
bfa0e33294f2b1dc25e65a33be2397f989824298 | ||
|
||
# reran black with linelength 80 for greater readability | ||
ea7c14f8ef64924f2d0ff80df3cdabf2c7299848 | ||
|
||
# Remove f-prefix from strings that don't use formatting | ||
7727fa4c8c6c1ef2b109120aff4196a0a6bf3ed6 | ||
|
||
# format tests/linear_4bit.py | ||
34735ba89de8235ea9da6ef409f814dcea9e2038 | ||
|
||
# Reformat with ruff-format | ||
5a4263f4dc05fe8f78f4111beab9f68a81deeab1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
groups: | ||
major: | ||
update-types: [major] | ||
minor-patch: | ||
update-types: [minor, patch] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import argparse | ||
import subprocess | ||
|
||
|
||
def main(): | ||
ap = argparse.ArgumentParser() | ||
ap.add_argument("wheels", nargs="*") | ||
args = ap.parse_args() | ||
if not args.wheels: | ||
ap.error("At least one wheel must be provided.") | ||
for whl in args.wheels: | ||
print(f"### `{whl}`") | ||
|
||
audit_wheel_output = subprocess.run( | ||
["auditwheel", "show", whl], | ||
capture_output=True, | ||
text=True, | ||
errors="backslashreplace", | ||
) | ||
|
||
if audit_wheel_output.stdout: | ||
print(audit_wheel_output.stdout) | ||
|
||
if audit_wheel_output.stderr: | ||
print(f"**Error:**\n```{audit_wheel_output.stderr}```") | ||
|
||
print("---") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
declare build_arch | ||
declare build_os | ||
|
||
set -xeuo pipefail | ||
|
||
pip install cmake==3.28.3 | ||
|
||
if [ "${build_os:0:6}" == ubuntu ] && [ "${build_arch}" == aarch64 ]; then | ||
# Allow cross-compile on aarch64 | ||
sudo apt-get update | ||
sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu | ||
cmake -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCOMPUTE_BACKEND=cpu . | ||
elif [ "${build_os:0:5}" == macos ] && [ "${build_arch}" == aarch64 ]; then | ||
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCOMPUTE_BACKEND=cpu . | ||
else | ||
cmake -DCOMPUTE_BACKEND=cpu . | ||
fi | ||
cmake --build . --config Release | ||
|
||
output_dir="output/${build_os}/${build_arch}" | ||
mkdir -p "${output_dir}" | ||
(shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} "${output_dir}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
declare build_arch | ||
declare build_os | ||
declare cuda_version | ||
|
||
set -xeuo pipefail | ||
build_capability="50;52;60;61;70;75;80;86;89;90" | ||
[[ "${cuda_version}" == 11.7.* ]] && build_capability=${build_capability%??????} | ||
[[ "${cuda_version}" == 11.8.* ]] && build_capability=${build_capability%???} | ||
[[ "${build_os}" = windows-* ]] && python3 -m pip install ninja | ||
for NO_CUBLASLT in ON OFF; do | ||
if [ "${build_os:0:6}" == ubuntu ]; then | ||
image=nvidia/cuda:${cuda_version}-devel-ubuntu22.04 | ||
echo "Using image $image" | ||
docker run --platform "linux/$build_arch" -i -w /src -v "$PWD:/src" "$image" sh -c \ | ||
"apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cmake \ | ||
&& cmake -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=\"${build_capability}\" -DNO_CUBLASLT=${NO_CUBLASLT} . \ | ||
&& cmake --build ." | ||
else | ||
pip install cmake==3.28.3 | ||
cmake -G Ninja -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY="${build_capability}" -DNO_CUBLASLT=${NO_CUBLASLT} -DCMAKE_BUILD_TYPE=Release -S . | ||
cmake --build . --config Release | ||
fi | ||
done | ||
|
||
output_dir="output/${build_os}/${build_arch}" | ||
mkdir -p "${output_dir}" | ||
(shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} "${output_dir}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import argparse | ||
import platform | ||
import sys | ||
|
||
|
||
def get_platform_tag(architecture): | ||
system = platform.system() | ||
|
||
if system == "Linux": | ||
tag = "manylinux_2_24_x86_64" if architecture == "x86_64" else "manylinux_2_24_aarch64" | ||
elif system == "Darwin": | ||
tag = "macosx_13_1_x86_64" if architecture == "x86_64" else "macosx_13_1_arm64" | ||
elif system == "Windows": | ||
tag = "win_amd64" if architecture == "x86_64" else "win_arm64" | ||
else: | ||
sys.exit(f"Unsupported system: {system}") | ||
|
||
return tag | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="Determine platform tag.") | ||
parser.add_argument("arch", type=str, help="Architecture (e.g., x86_64, aarch64)") | ||
args = parser.parse_args() | ||
|
||
tag = get_platform_tag(args.arch) | ||
|
||
print(tag) # This will be captured by the GitHub Actions workflow | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
Lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
- uses: pre-commit/action@v3.0.0 | ||
env: | ||
RUFF_OUTPUT_FORMAT: github |
Oops, something went wrong.