-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
364 additions
and
262 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 |
---|---|---|
|
@@ -15,10 +15,13 @@ on: | |
- 'setup.py' | ||
- 'pyproject.toml' | ||
- 'pytest.ini' | ||
- '**/*.md' | ||
release: | ||
types: [ published ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
## | ||
|
@@ -43,16 +46,10 @@ jobs: | |
uses: jwlawson/[email protected] | ||
with: | ||
cmake-version: '3.26.x' | ||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ startsWith(matrix.os, 'windows') }} | ||
# Check out dependencies code | ||
- uses: actions/checkout@v4 | ||
name: Check out NVidia cub | ||
with: | ||
repository: nvidia/cub | ||
ref: 1.11.0 | ||
path: dependencies/cub | ||
- name: Setup MSVC | ||
if: startsWith(matrix.os, 'windows') | ||
#uses: microsoft/[email protected] # to use msbuild | ||
uses: ilammy/[email protected] # to use cl | ||
# Compile C++ code | ||
- name: Build C++ | ||
shell: bash | ||
|
@@ -62,18 +59,14 @@ jobs: | |
build_arch=${{ matrix.arch }} | ||
if [ ${build_os:0:6} == ubuntu -a ${build_arch} == aarch64 ]; then | ||
# Allow cross-compile om aarch64 | ||
sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu | ||
fi | ||
if [ ${build_os:0:5} == macos -a ${build_arch} == aarch64 ]; then | ||
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 -a ${build_arch} == aarch64 ]; then | ||
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCOMPUTE_BACKEND=cpu . | ||
else | ||
cmake -DCOMPUTE_BACKEND=cpu . | ||
fi | ||
if [ ${build_os:0:7} == windows ]; then | ||
pwsh -Command "msbuild bitsandbytes.vcxproj /property:Configuration=Release" | ||
else | ||
make | ||
fi | ||
cmake --build . --config Release | ||
mkdir -p output/${{ matrix.os }}/${{ matrix.arch }} | ||
( shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} output/${{ matrix.os }}/${{ matrix.arch }}/ ) | ||
- name: Upload build artifact | ||
|
@@ -121,37 +114,34 @@ jobs: | |
id: cuda-toolkit | ||
with: | ||
cuda: ${{ env.CUDA_VERSION }} | ||
method: 'local' | ||
# sub-packages: '["nvcc","cudart","nvrtc_dev","cublas_dev","cusparse_dev","visual_studio_integration"]' | ||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ startsWith(matrix.os, 'windows') }} | ||
# Check out dependencies code | ||
- uses: actions/checkout@v4 | ||
name: Check out NVidia cub | ||
with: | ||
repository: nvidia/cub | ||
ref: 1.11.0 | ||
path: dependencies/cub | ||
method: 'network' | ||
sub-packages: '["nvcc","cudart","cusparse","cublas","thrust","nvrtc_dev","cublas_dev","cusparse_dev"]' | ||
linux-local-args: '["--toolkit"]' | ||
use-github-cache: false | ||
- name: Setup MSVC | ||
if: startsWith(matrix.os, 'windows') | ||
#uses: microsoft/[email protected] # to use msbuild | ||
uses: ilammy/[email protected] # to use cl | ||
# Compile C++ code | ||
- name: Build C++ | ||
shell: bash | ||
run: | | ||
set -ex | ||
build_os=${{ matrix.os }} | ||
build_arch=${{ matrix.arch }} | ||
[[ "${{ matrix.os }}" = windows-* ]] && python3 -m pip install ninja | ||
for NO_CUBLASLT in ON OFF; do | ||
if [ ${build_os:0:6} == ubuntu ]; then | ||
image=nvidia/cuda:${{ env.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 -DNO_CUBLASLT=${NO_CUBLASLT} . \ | ||
&& make" | ||
&& cmake -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=\"50;52;60;61;70;75;80;86;89;90\" -DNO_CUBLASLT=${NO_CUBLASLT} . \ | ||
&& cmake --build ." | ||
else | ||
cmake -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} . | ||
pwsh -Command "msbuild bitsandbytes.vcxproj /property:Configuration=Release" | ||
cmake -G Ninja -DCOMPUTE_BACKEND=cuda -DNO_CUBLASLT=${NO_CUBLASLT} -DCMAKE_BUILD_TYPE=Release -S . | ||
cmake --build . --config Release | ||
fi | ||
done | ||
mkdir -p output/${{ matrix.os }}/${{ matrix.arch }} | ||
|
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 |
---|---|---|
|
@@ -18,6 +18,6 @@ repos: | |
args: | ||
- --fix=lf | ||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.17.2 | ||
rev: v1.18.2 | ||
hooks: | ||
- id: typos |
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
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
Oops, something went wrong.