Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Python 3.12 and PyTorch 2.4.1 #265

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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 .github/workflows/e2e-nvidia-t4-x1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,23 @@ jobs:
- name: Install system packages
run: |
cat /etc/os-release
sudo dnf install -y gcc gcc-c++ make git python3.11 python3.11-devel
sudo dnf install -y gcc gcc-c++ make git python3.12 python3.12-devel

- name: Install instructlab
working-directory: ./instructlab
run: |
export PATH="/home/ec2-user/.local/bin:/usr/local/cuda/bin:$PATH"
python3.11 -m venv --upgrade-deps venv
python3.12 -m venv --upgrade-deps venv
. venv/bin/activate
nvidia-smi
python3.11 -m pip cache remove llama_cpp_python
python3.12 -m pip cache remove llama_cpp_python

CMAKE_ARGS="-DLLAMA_CUDA=on" python3.11 -m pip install .
CMAKE_ARGS="-DLLAMA_CUDA=on" python3.12 -m pip install .

# https://github.com/instructlab/instructlab/issues/1821
# install with Torch and build dependencies installed
python3.11 -m pip install packaging wheel setuptools-scm
python3.11 -m pip install .[cuda]
python3.12 -m pip install packaging wheel setuptools-scm
python3.12 -m pip install .[cuda]

- name: Update instructlab-training library
working-directory: ./training
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ jobs:
# https://github.com/actions/checkout/issues/249
fetch-depth: 0

- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.11
python-version: 3.12
cache: pip
cache-dependency-path: |
**/pyproject.toml
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ package-dir = { "" = "src" }

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
optional-dependencies.cuda = { file = ["requirements-cuda.txt"] }
optional-dependencies.rocm = { file = ["requirements-rocm.txt"] }
optional-dependencies.cpu = { file = ["requirements/cpu.txt"] }
optional-dependencies.cuda = { file = ["requirements/cuda.txt"] }
optional-dependencies.hpu = { file = ["requirements/hpu.txt"] }
optional-dependencies.mps = { file = ["requirements/mps.txt"] }
optional-dependencies.rocm = { file = ["requirements/rocm.txt"] }

[tool.setuptools.packages.find]
where = ["src"]
Expand Down
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ packaging>=20.9
wheel>=0.43
pyyaml
py-cpuinfo
# we set this to be above 0a0 so that it doesn't
# replace custom pytorch images with the 2.3.0
torch>=2.3.0a0
torch>=2.4.1,<2.5.0
transformers>=4.41.2
accelerate>=0.34.2
datasets>=2.15.0
Expand Down
Empty file added requirements/cpu.txt
Empty file.
File renamed without changes.
12 changes: 12 additions & 0 deletions requirements/hpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Dependencies for Intel Gaudi / Habana Labs HPU devices

# Habana Labs 1.17.1 has PyTorch 2.3.1a0+gitxxx pre-release
torch>=2.3.1a0,<2.4.0
# Habana Labs frameworks
habana-torch-plugin>=1.17.1
habana_gpu_migration>=1.17.1
# additional Habana Labs packages (installed, but not used)
#habana-media-loader
#habana-pyhlml
#habana_quantization_toolkit
#habana-torch-dataloader
Empty file added requirements/mps.txt
Empty file.
File renamed without changes.
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[tox]
# py3-unit runs unit tests with 'python3'
# py311-unit runs the same tests with 'python3.11'
# py312-unit runs the same tests with 'python3.12'
envlist = ruff, lint, mypy, spellcheck
minversion = 4.4

Expand All @@ -17,7 +17,7 @@ deps =
pytest-html

[testenv:py3]
basepython = python3.11
basepython = python3.12

# format, check, and linting targets don't build and install the project to
# speed up testing.
Expand Down