-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make overall
optimum-nvidia
pip installable (#83)
* Add dependencies on tensorrt-llm and additional nvidia repository * Attempt to have pip working with manually building the index url * make `optimum-nvidia` pip installable * Update setup.py to latest requirements * Let's remove tensorrtllm dependency for now to avoid transformers conflict * pip install optimum-nvidia in the containers * Ping huggingface_hub to 0.20.0 * Quality
- Loading branch information
1 parent
8119ca4
commit 816ec44
Showing
8 changed files
with
112 additions
and
51 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
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 |
---|---|---|
@@ -1,23 +1,16 @@ | ||
FROM tensorrt_llm/release:latest | ||
|
||
# 70 = V100 | ||
# 75 = T4/RTX Quadro | ||
# 80 = A100/A30 | ||
# 86 = A10/A40/RTX Axxx | ||
# 89 = L4/L40/L40s/RTX Ada/4090 | ||
# 90 = H100/H200 | ||
#ARG TARGET_CUDA_ARCHS="70-real;75-real;80-real;86-real;89-real;90-real" | ||
#ARG TARGET_CUDA_ARCHS="75-real;80-real;86-real;89-real;90-real" | ||
|
||
COPY . /opt/optimum-nvidia | ||
|
||
# Install tensorrt-llm | ||
# TODO: Reduce the container size removing build artifacts | ||
WORKDIR /opt/optimum-nvidia/third-party/tensorrt-llm | ||
|
||
# Install dependencies | ||
RUN python -m pip install --upgrade --no-cache-dir datasets huggingface_hub hf-transfer optimum transformers pynvml | ||
ENV PYTHONPATH=/opt/optimum-nvidia/src:$PYTHONPATH | ||
RUN python -m pip install /opt/optimum-nvidia | ||
|
||
#Add the project sources to the final layer | ||
COPY . /opt/optimum-nvidia | ||
# Let's put our users in the examples folder | ||
WORKDIR /opt/optimum-nvidia/examples |
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 |
---|---|---|
@@ -1,4 +1,16 @@ | ||
FROM tensorrt_llm:latest | ||
FROM tensorrt_llm/devel:latest | ||
|
||
# 75 = T4/RTX Quadro | ||
# 80 = A100/A30 | ||
# 86 = A10/A40/RTX Axxx | ||
# 89 = L4/L40/L40s/RTX Ada/4090 | ||
# 90 = H100/H200 | ||
#ARG TARGET_CUDA_ARCHS="75-real;80-real;86-real;89-real;90-real" | ||
|
||
COPY . /opt/optimum-nvidia | ||
|
||
# Install dependencies | ||
RUN python -m pip install --no-cache-dir --upgrade accelerate datasets huggingface_hub hf-transfer optimum transformers pynvml | ||
RUN python -m pip install /opt/optimum-nvidia | ||
|
||
# Let's put our users in the examples folder | ||
WORKDIR /opt/optimum-nvidia/examples |
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 |
---|---|---|
@@ -1,3 +1,57 @@ | ||
[project] | ||
name = "optimum-nvidia" | ||
requires-python = ">= 3.10" | ||
dynamic = ["version"] | ||
description = """Optimum Nvidia is the interface between the Hugging Face Transformers and NVIDIA GPUs. " | ||
"It provides a set of tools enabling easy model loading, training and " | ||
"inference on single and multiple GPU cards for different downstream tasks.""" | ||
|
||
# Some contact information | ||
authors = [{name = "HuggingFace Inc. Machine Learning Optimization Team", email = "[email protected]"}] | ||
keywords = ["transformers", "neural-network", "inference", "nvidia", "tensorrt", "ampere", "hopper"] | ||
readme = "README.md" | ||
license = {text = "Apache/2.0", file="LICENSE"} | ||
classifiers = [ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Intended Audience :: Science/Research", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.10", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://huggingface.co/hardware/nvidia" | ||
Repository = "https://github.com/huggingface/optimum-nvidia" | ||
Issues = "https://github.com/huggingface/optimum-nvidia/issues" | ||
|
||
# List dependencies | ||
dependencies = [ | ||
"accelerate", | ||
"dataset", | ||
"huggingface_hub > 0.17.0, < 0.21.0", | ||
"hf-transfer", | ||
"numpy >= 1.22.0", | ||
"onnx >= 1.12.0", | ||
"optimum >= 1.13.0", | ||
"setuptools", | ||
"transformers >= 4.38.1", | ||
# "tensorrt_llm", | ||
"pynvml" | ||
] | ||
|
||
# List additional dependencies | ||
[project.optional-dependencies] | ||
test = ["pytest", "psutil", "parameterized", "datasets", "safetensors",] | ||
quality = ["black", "ruff", "isort", "hf_doc_builder @ git+https://github.com/huggingface/doc-builder.git",] | ||
|
||
# Configure build system | ||
[build-system] | ||
requires = ["setuptools"] | ||
|
||
# Configure tools around | ||
[tool.ruff] | ||
# Never enforce `E501` (line length violations). | ||
ignore = ["C901", "E501", "E741", "F402", "F823" ] | ||
|
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