diff --git a/Dockerfile b/Dockerfile index 834474f8f..ce02b3dd8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 @@ -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 @@ -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 . @@ -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= qefficient-library \ No newline at end of file +# docker run -e MODEL_NAME=gpt2 -e TOKEN_ID= qefficient-library diff --git a/README.md b/README.md index 257fd6344..bc34f5de4 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. diff --git a/docs/source/finetune.md b/docs/source/finetune.md index 285368f21..f4e15910d 100644 --- a/docs/source/finetune.md +++ b/docs/source/finetune.md @@ -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. diff --git a/docs/source/installation.md b/docs/source/installation.md index 5f7207c3b..422c19c50 100644 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -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 diff --git a/examples/performance/on_device_sampling.py b/examples/performance/on_device_sampling.py index da9c5b43b..c34a241c8 100644 --- a/examples/performance/on_device_sampling.py +++ b/examples/performance/on_device_sampling.py @@ -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 \ @@ -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 \ @@ -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 \ diff --git a/pyproject.toml b/pyproject.toml index f38bcc17d..a1082fdfe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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] diff --git a/scripts/Jenkinsfile b/scripts/Jenkinsfile index d51765a4d..4cf9e108d 100644 --- a/scripts/Jenkinsfile +++ b/scripts/Jenkinsfile @@ -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] && @@ -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 && @@ -252,4 +254,4 @@ pipeline { // deleteDir() // } } -} \ No newline at end of file +}