Skip to content

Commit

Permalink
misc/py-accelerate: New port: PyTorch: simple way to launch, train, u…
Browse files Browse the repository at this point in the history
…se PyTorch models on any device
  • Loading branch information
yurivict committed Apr 27, 2024
1 parent e9f2c79 commit dc61470
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions misc/Makefile
Expand Up @@ -400,6 +400,7 @@
SUBDIR += py-SQSnobFit
SUBDIR += py-SimpleSoapy
SUBDIR += py-SoapySDR
SUBDIR += py-accelerate
SUBDIR += py-alive-progress
SUBDIR += py-apache-beam
SUBDIR += py-ascii-magic
Expand Down
31 changes: 31 additions & 0 deletions misc/py-accelerate/Makefile
@@ -0,0 +1,31 @@
PORTNAME= accelerate
DISTVERSION= 0.29.3
CATEGORIES= misc # machine-learning
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

MAINTAINER= yuri@FreeBSD.org
COMMENT= PyTorch: simple way to launch, train, use PyTorch models on any device
WWW= https://huggingface.co/docs/accelerate/index

LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= ${PY_SETUPTOOLS} \
${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}huggingface-hub>0:misc/py-huggingface-hub@${PY_FLAVOR} \
${PYNUMPY} \
${PYTHON_PKGNAMEPREFIX}packaging>=20.0:devel/py-packaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytorch>0:misc/py-pytorch@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}safetensors>=0.3.1:misc/py-safetensors@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}parameterized>0:devel/py-parameterized@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}torchvision>0:misc/py-torchvision@${PY_FLAVOR}

USES= python
USE_PYTHON= pep517 autoplist pytest # tests fail because they depend on the module 'transformers' that depends on 'accelerate' and isn't yet ported

NO_ARCH= yes

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions misc/py-accelerate/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1714171436
SHA256 (accelerate-0.29.3.tar.gz) = 1a5a845b06b24b41736b219b2b20fd021ca5dff4070a252445fd6de736e347ac
SIZE (accelerate-0.29.3.tar.gz) = 295357
3 changes: 3 additions & 0 deletions misc/py-accelerate/pkg-descr
@@ -0,0 +1,3 @@
The accelerate module was created for PyTorch users who like to write the
training loop of PyTorch models but are reluctant to write and maintain the
boilerplate code needed to use multi-GPUs/TPU/fp16.

0 comments on commit dc61470

Please sign in to comment.