Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ FROM docker-registry.qualcomm.com/library/ubuntu:20.04
RUN apt-get update && apt-get install -y \
git \
tmux \
python3.10 \
python3.10-venv \
python3.12 \
python3.12-venv \
python3-pip

# pip recognizes this variable
Expand All @@ -24,7 +24,7 @@ RUN mkdir -p /app/qefficient-library
COPY . /app/qefficient-library

# Create Virtual Env for the docker image
RUN python3.10 -m venv /app/llm_env
RUN python3.12 -m venv /app/llm_env
RUN . /app/llm_env/bin/activate
WORKDIR /app/qefficient-library

Expand All @@ -33,7 +33,7 @@ WORKDIR /app/qefficient-library
RUN pip install torch==2.0.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu --no-deps
RUN pip install datasets==2.17.0 fsspec==2023.10.0 multidict==6.0.5 sentencepiece --no-deps

RUN python3.10 -m pip install .
RUN python3.12 -m pip install .
WORKDIR /app/qefficient-library

# Set the environment variable for the model card name and token ID
Expand All @@ -45,7 +45,7 @@ ENV TOKEN_ID = ""
# Print a success message
CMD ["echo", "qefficient-transformers repository cloned and setup installed inside Docker image."]
CMD ["echo", "Starting the Model Download and Export to Onnx Stage for QEff."]
CMD python3.10 -m QEfficient.cloud.export --model-name "$MODEL_NAME"
CMD python3.12 -m QEfficient.cloud.export --model-name "$MODEL_NAME"

# Example usage:
# docker build -t qefficient-library .
Expand All @@ -55,4 +55,4 @@ CMD python3.10 -m QEfficient.cloud.export --model-name "$MODEL_NAME"
# 2. For smaller models, 32GiB RAM is sufficient, but larger LLMs we require good CPU/RAM (Context 7B model would require atleast 64GiB).
# 3. The exact minimum system configuration are tough to decide, since its all function of model parameters.

# docker run -e MODEL_NAME=gpt2 -e TOKEN_ID=<your-token-id> qefficient-library
# docker run -e MODEL_NAME=gpt2 -e TOKEN_ID=<your-token-id> qefficient-library
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ For other models, there is comprehensive documentation to inspire upon the chang
## Quick Installation
```bash

# Create Python virtual env and activate it. (Recommended Python 3.10)
sudo apt install python3.10-venv
python3.10 -m venv qeff_env
# Create Python virtual env and activate it. (Recommended Python 3.12)
sudo apt install python3.12-venv
python3.12 -m venv qeff_env
source qeff_env/bin/activate
pip install -U pip

Expand Down Expand Up @@ -136,4 +136,4 @@ Thanks to:
If you run into any problems with the code, please file Github issues directly to this repo.

## Contributing
This project welcomes contributions and suggestions. Please check the License. Integration with a CLA Bot is underway.
This project welcomes contributions and suggestions. Please check the License. Integration with a CLA Bot is underway.
2 changes: 1 addition & 1 deletion docs/source/finetune.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For QEfficient Library : https://github.com/quic/efficient-transformers

For torch_qaic, assuming QEfficient is already installed,
```bash
pip install /opt/qti-aic/integrations/torch_qaic/py310/torch_qaic-0.1.0-cp310-cp310-linux_x86_64.whl
pip install /opt/qti-aic/integrations/torch_qaic/py312/torch_qaic-0.1.0-cp312-cp312-linux_x86_64.whl
```
If qeff-env inside docker is used then torch_qaic and accelerate packages are already installed.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Efficient Transformers have been validated to work with the same compatible SDK.
```bash
# Create Python virtual env and activate it. (Required Python 3.10)

python3.10 -m venv qeff_env
python3.12 -m venv qeff_env
source qeff_env/bin/activate
pip install -U pip

Expand Down
6 changes: 3 additions & 3 deletions examples/performance/on_device_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def main(args, **kwargs):
"""
Example usage:
1. For continuous batching:
python3.10 examples/on_device_sampling.py \
python examples/on_device_sampling.py \
--model-name 'meta-llama/Llama-3.1-8B' \
--prompt-len 128 \
--ctx-len 256 \
Expand All @@ -134,7 +134,7 @@ def main(args, **kwargs):
--random-number 26

2. For non-continuous batching:
python3.10 examples/on_device_sampling.py \
python examples/on_device_sampling.py \
--model-name 'meta-llama/Llama-3.1-8B' \
--prompt-len 128 \
--ctx-len 256 \
Expand All @@ -154,7 +154,7 @@ def main(args, **kwargs):
--random-number 26

3. With guided decoding:
python3.10 examples/on_device_sampling.py \
python examples/on_device_sampling.py \
--model-name 'meta-llama/Llama-3.1-8B' \
--prompt-len 128 \
--ctx-len 256 \
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Operating System :: Linux",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence for Inference Accelerator",
]
requires-python = ">=3.8,<3.11"
requires-python = ">=3.8,<3.13"
dependencies = [
"transformers==4.55.0",
"diffusers== 0.35.1",
Expand Down Expand Up @@ -48,8 +48,12 @@ dependencies = [
"torch@https://download.pytorch.org/whl/cpu/torch-2.4.1%2Bcpu-cp38-cp38-linux_x86_64.whl ; python_version=='3.8' and platform_machine=='x86_64'",
"torch@https://download.pytorch.org/whl/cpu/torch-2.7.0%2Bcpu-cp39-cp39-manylinux_2_28_x86_64.whl ; python_version=='3.9' and platform_machine=='x86_64'",
"torch@https://download.pytorch.org/whl/cpu/torch-2.7.0%2Bcpu-cp310-cp310-manylinux_2_28_x86_64.whl ; python_version=='3.10' and platform_machine=='x86_64'",
"torch@https://download.pytorch.org/whl/cpu/torch-2.7.0%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl ; python_version=='3.11' and platform_machine=='x86_64'",
"torch@https://download.pytorch.org/whl/cpu/torch-2.7.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl ; python_version=='3.12' and platform_machine=='x86_64'",
"torchvision@https://download.pytorch.org/whl/cpu/torchvision-0.22.0%2Bcpu-cp39-cp39-manylinux_2_28_x86_64.whl ; python_version=='3.9' and platform_machine=='x86_64'",
"torchvision@https://download.pytorch.org/whl/cpu/torchvision-0.22.0%2Bcpu-cp310-cp310-manylinux_2_28_x86_64.whl ; python_version=='3.10' and platform_machine=='x86_64'",
"torchvision@https://download.pytorch.org/whl/cpu/torchvision-0.22.0%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl ; python_version=='3.11' and platform_machine=='x86_64'",
"torchvision@https://download.pytorch.org/whl/cpu/torchvision-0.22.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl ; python_version=='3.12' and platform_machine=='x86_64'",
]

[project.optional-dependencies]
Expand Down
10 changes: 6 additions & 4 deletions scripts/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pipeline {
sudo docker exec ${BUILD_TAG} bash -c "
cd /efficient-transformers &&
apt update &&
apt install -y python3.10-venv &&
python3.10 -m venv preflight_qeff &&
DEBIAN_FRONTEND=noninteractive apt install -y tzdata python3.12-venv python3.12-dev build-essential &&
python3.12 -m venv preflight_qeff &&
. preflight_qeff/bin/activate &&
pip install --upgrade pip setuptools &&
pip install .[test] &&
Expand Down Expand Up @@ -185,7 +185,9 @@ pipeline {
sudo docker exec ${BUILD_TAG} bash -c "
cd /efficient-transformers &&
. preflight_qeff/bin/activate &&
pip install /opt/qti-aic/integrations/torch_qaic/py310/torch_qaic-0.1.0-cp310-cp310-linux_x86_64.whl &&
# TODO: Update torch_qaic path to py312 when migrating to Python 3.12
pip install /opt/qti-aic/integrations/torch_qaic/py312/torch_qaic-0.1.0-cp312-cp312-linux_x86_64.whl &&
# pip install /opt/qti-aic/integrations/torch_qaic/py310/torch_qaic-0.1.0-cp310-cp310-linux_x86_64.whl &&
pip install torch==2.9.0 torchvision==0.24.0 torchaudio==2.9.0 --index-url https://download.pytorch.org/whl/cpu &&
mkdir -p $PWD/cli_qaic_finetuning &&
export TOKENIZERS_PARALLELISM=false &&
Expand Down Expand Up @@ -252,4 +254,4 @@ pipeline {
// deleteDir()
// }
}
}
}
Loading