| 1 |
# Copyright 2021 The HuggingFace Team. All rights reserved. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
from setuptools import find_packages, setup |
| 16 |
|
| 17 |
|
| 18 |
extras = {} |
| 19 |
extras["quality"] = ["ruff == 0.13.1"] |
| 20 |
|
| 21 |
extras["docs"] = [] |
| 22 |
extras["test_prod"] = ["pytest>=7.2.0", "pytest-xdist", "pytest-subtests", "parameterized", "pytest-order"] |
| 23 |
extras["test_dev"] = [ |
| 24 |
"datasets", |
| 25 |
"diffusers", |
| 26 |
"evaluate", |
| 27 |
"torchdata>=0.8.0", |
| 28 |
"torchpippy>=0.2.0", |
| 29 |
"transformers", |
| 30 |
"scipy", |
| 31 |
"scikit-learn", |
| 32 |
"tqdm", |
| 33 |
"bitsandbytes", |
| 34 |
"timm", |
| 35 |
] |
| 36 |
extras["testing"] = extras["test_prod"] + extras["test_dev"] |
| 37 |
extras["deepspeed"] = ["deepspeed"] |
| 38 |
extras["rich"] = ["rich"] |
| 39 |
|
| 40 |
extras["test_fp8"] = ["torchao"] # note: TE for now needs to be done via pulling down the docker image directly |
| 41 |
extras["test_trackers"] = [ |
| 42 |
"wandb", |
| 43 |
"tensorboard", |
| 44 |
"dvclive", |
| 45 |
# "mlflow", too many deps that lead to download a very old version of the lib |
| 46 |
"matplotlib", |
| 47 |
"swanlab[dashboard]", # dashboard required for local use |
| 48 |
"trackio", |
| 49 |
] |
| 50 |
extras["dev"] = extras["quality"] + extras["testing"] + extras["rich"] |
| 51 |
|
| 52 |
extras["sagemaker"] = [ |
| 53 |
"sagemaker", # boto3 is a required package in sagemaker |
| 54 |
] |
| 55 |
|
| 56 |
setup( |
| 57 |
name="accelerate", |
| 58 |
version="1.14.0", |
| 59 |
description="Accelerate", |
| 60 |
long_description=open("README.md", encoding="utf-8").read(), |
| 61 |
long_description_content_type="text/markdown", |
| 62 |
keywords="deep learning", |
| 63 |
license="Apache", |
| 64 |
author="The Hugging Face team", |
| 65 |
author_email="[email protected]", |
| 66 |
url="https://github.com/huggingface/accelerate", |
| 67 |
package_dir={"": "src"}, |
| 68 |
packages=find_packages("src"), |
| 69 |
entry_points={ |
| 70 |
"console_scripts": [ |
| 71 |
"accelerate=accelerate.commands.accelerate_cli:main", |
| 72 |
"accelerate-config=accelerate.commands.config:main", |
| 73 |
"accelerate-estimate-memory=accelerate.commands.estimate:main", |
| 74 |
"accelerate-launch=accelerate.commands.launch:main", |
| 75 |
"accelerate-merge-weights=accelerate.commands.merge:main", |
| 76 |
] |
| 77 |
}, |
| 78 |
python_requires=">=3.10.0", |
| 79 |
install_requires=[ |
| 80 |
"numpy>=1.17", |
| 81 |
"packaging>=20.0", |
| 82 |
"psutil", |
| 83 |
"pyyaml", |
| 84 |
"torch>=2.0.0", |
| 85 |
"huggingface_hub>=0.21.0", |
| 86 |
"safetensors>=0.4.3", |
| 87 |
], |
| 88 |
extras_require=extras, |
| 89 |
classifiers=[ |
| 90 |
"Development Status :: 5 - Production/Stable", |
| 91 |
"Intended Audience :: Developers", |
| 92 |
"Intended Audience :: Education", |
| 93 |
"Intended Audience :: Science/Research", |
| 94 |
"License :: OSI Approved :: Apache Software License", |
| 95 |
"Operating System :: OS Independent", |
| 96 |
"Programming Language :: Python :: 3", |
| 97 |
"Programming Language :: Python :: 3.10", |
| 98 |
"Topic :: Scientific/Engineering :: Artificial Intelligence", |
| 99 |
], |
| 100 |
) |
| 101 |
|
| 102 |
# Release checklist |
| 103 |
# 1. Checkout the release branch (for a patch the current release branch, for a new minor version, create one): |
| 104 |
# git checkout -b vXX.xx-release |
| 105 |
# The -b is only necessary for creation (so remove it when doing a patch) |
| 106 |
# 2. Change the version in __init__.py and setup.py to the proper value. |
| 107 |
# 3. Commit these changes with the message: "Release: v<VERSION>" |
| 108 |
# 4. Add a tag in git to mark the release: |
| 109 |
# git tag v<VERSION> -m 'Adds tag v<VERSION> for pypi' |
| 110 |
# Push the tag and release commit to git: git push --tags origin vXX.xx-release |
| 111 |
# 5. Run the following commands in the top-level directory: |
| 112 |
# make prepare_release |
| 113 |
# 6. Upload the package to the pypi test server first: |
| 114 |
# make target=testpypi upload_release |
| 115 |
# 7. Check that you can install it in a virtualenv by running: |
| 116 |
# make install_test_release |
| 117 |
# accelerate env |
| 118 |
# accelerate test |
| 119 |
# 8. Upload the final version to actual pypi: |
| 120 |
# make target=pypi upload_release |
| 121 |
# 9. Add release notes to the tag in github once everything is looking hunky-dory. |
| 122 |
# 10. Go back to the main branch and update the version in __init__.py, setup.py to the new version ".dev" and push to |
| 123 |
# main. |