diff options
author | Premysl Srubar | 2024-11-15 23:17:47 +0100 |
---|---|---|
committer | Premysl Srubar | 2024-11-15 23:18:57 +0100 |
commit | 39468c912d3c513ae74c4b42e65e43b54ce23649 (patch) | |
tree | 4601ee6552c250cf790ce0407d4476d6f0d8bdc2 | |
parent | b0254038e451d317c2e62e7d81daec9efb51f22e (diff) | |
download | aur-python-bitsandbytes-git.tar.gz |
Cleanup. Removed explicit CUDA detection. Not needed anymore.
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | PKGBUILD | 49 |
2 files changed, 32 insertions, 28 deletions
@@ -1,17 +1,22 @@ pkgbase = python-bitsandbytes-git pkgdesc = Lightweight wrapper around CUDA custom functions, in particular 8-bit optimizers, matrix multiplication (LLM.int8()), and quantization functions. - pkgver = 0.41.0.r50.gf63abb5 + pkgver = 0.44.1.11.g9264f02 pkgrel = 1 url = https://github.com/TimDettmers/bitsandbytes arch = x86_64 license = MIT checkdepends = python-pytest - makedepends = python-setuptools + makedepends = python-build + makedepends = python-installer makedepends = git depends = python>=3.9 depends = cuda>=11.0 - depends = openssl depends = python-pytorch + depends = python-einops + depends = python-scipy + depends = python-accelerate + depends = python-transformers + depends = python-lion-pytorch provides = python-bitsandbytes conflicts = python-bitsandbytes source = python-bitsandbytes-git::git+https://github.com/TimDettmers/bitsandbytes.git @@ -1,15 +1,19 @@ # Maintainer: Premysl Srubar <premysl.srubar[äT]gmail(.)com> _pkgname=bitsandbytes pkgname=('python-bitsandbytes-git') -pkgver=0.41.0.r50.gf63abb5 +pkgver=0.44.1.11.g9264f02 pkgrel=1 pkgdesc="Lightweight wrapper around CUDA custom functions, in particular 8-bit optimizers, matrix multiplication (LLM.int8()), and quantization functions." depends=( 'python>=3.9' - 'cuda>=11.0' - 'openssl' + 'cuda>=11.0' 'python-pytorch' + 'python-einops' + 'python-scipy' + 'python-accelerate' + 'python-transformers' + 'python-lion-pytorch' ) provides=('python-bitsandbytes') @@ -17,54 +21,49 @@ conflicts=('python-bitsandbytes') arch=('x86_64') url="https://github.com/TimDettmers/bitsandbytes" license=("MIT") -makedepends=('python-setuptools' 'git') +makedepends=('python-build' 'python-installer' 'git') checkdepends=('python-pytest') source=("${pkgname}::git+${url}.git") sha256sums=('SKIP') - pkgver() { cd "$srcdir/${pkgname}" - git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' + + # Get the most recent semantic version tag like 0.44.1 + local latest_tag=$(git tag | grep -E '^([0-9]+\.[0-9]+\.[0-9]+)$' | sort -V | tail -n 1) + + # Get commit count since the latest tag and current commit hash + local git_info=$(git describe --long --tags --match "$latest_tag" | sed 's/^[^-]*-//;s/-/./g') + + # Construct full package version + echo "${latest_tag}.${git_info}" } build() { - # https://github.com/TimDettmers/bitsandbytes/blob/main/compile_from_source.md cd "$pkgname" - # Detect local cuda version (12.3) and remove the dot. BNB is using the {major}{minor} notation like: (123) - BNB_CUDA_VERSION=$(nvcc --version | grep "release" | sed 's/.*release //' | sed 's/,.*//' | sed 's/\.//') - # Find the cuda runtimes lib location - CUDA_LIB_PATH=$(ldconfig -p | grep libcudart.so | head -n 1 | tr -s ' ' | cut -d ' ' -f 4) - - # Extract the parent directory. BNB just searches all environment variables containing a `/` considering them a possible cuda path - export CUDA_LIB_DIR=$(dirname "$CUDA_LIB_PATH") - - # Check if the path is valid and non-empty - if [ -z "$CUDA_LIB_DIR" ] || [ ! -d "$CUDA_LIB_DIR" ]; then - printf "\e[1;31mError:\e[0m CUDA library directory not found. No `libcudart.so` in `ldconfig -p` \n" - exit 1 - fi - # echo found cuda $BNB_CUDA_VERSION at $CUDA_LIB_DIR - make cuda12x CUDA_VERSION=$BNB_CUDA_VERSION - + cmake -DCOMPUTE_BACKEND=cuda -S . + make + python -m build --wheel --no-isolation } check() { cd "$pkgname" - python setup.py test + # slow + #pytest } package() { cd "$pkgname" - python setup.py install --optimize=1 --root="${pkgdir}/" + python -m installer --destdir="$pkgdir" dist/*.whl # Remove tests rm -rf ${pkgdir}/usr/lib/python*/site-packages/tests/ install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + } |