From e4897f8972cf5ccf48c1d4b6988a43f65a4935dd Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 26 Jun 2024 17:40:23 -0700 Subject: [PATCH 01/10] remove torch dependency --- .github/workflows/nightly_smoke_test.yml | 8 +++++++- .github/workflows/regression_test.yml | 9 ++++++++- setup.py | 14 +++++++------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nightly_smoke_test.yml b/.github/workflows/nightly_smoke_test.yml index 1b0026c63c..33ba1e0925 100644 --- a/.github/workflows/nightly_smoke_test.yml +++ b/.github/workflows/nightly_smoke_test.yml @@ -33,7 +33,13 @@ jobs: gpu-arch-version: ${{ matrix.gpu-arch-version }} script: | python -m pip install --upgrade pip - pip install ${{ matrix.torch-spec }} + PYTORCH_VERSION=${{ env.PYTORCH_VERSION }} + if [ -z "$PYTORCH_VERSION" ]; then + PYTORCH_DEP="torch" + else + PYTORCH_DEP="torch==$PYTORCH_VERSION" + fi + echo "Installing PyTorch dependency: $PYTORCH_DEP" pip install -r dev-requirements.txt python setup.py install pytest test --verbose -s diff --git a/.github/workflows/regression_test.yml b/.github/workflows/regression_test.yml index 21ad6535a3..50e683e64c 100644 --- a/.github/workflows/regression_test.yml +++ b/.github/workflows/regression_test.yml @@ -65,7 +65,14 @@ jobs: yum install -y devtoolset-10-binutils export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH python -m pip install --upgrade pip - pip install ${{ matrix.torch-spec }} + PYTORCH_VERSION=${{ env.PYTORCH_VERSION }} + if [ -z "$PYTORCH_VERSION" ]; then + PYTORCH_DEP="torch" + else + PYTORCH_DEP="torch==$PYTORCH_VERSION" + fi + echo "Installing PyTorch dependency: $PYTORCH_DEP" + pip install $PYTORCH_DEP pip install -r dev-requirements.txt pip install . pytest test --verbose -s diff --git a/setup.py b/setup.py index a6a2da8a75..365dbb47e2 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ # LICENSE file in the root directory of this source tree. import os +os.system("pip install torch") import glob from datetime import datetime @@ -111,13 +112,13 @@ def get_extensions(): return ext_modules # Mimic code from torchvision https://github.com/pytorch/vision/blob/143d078b28f00471156a4e562dd3836370acc9ee/setup.py#L58 -pytorch_dep = "torch" -if os.getenv("PYTORCH_VERSION"): - pytorch_dep += "==" + os.getenv("PYTORCH_VERSION") +# pytorch_dep = "torch" +# if os.getenv("PYTORCH_VERSION"): +# pytorch_dep += "==" + os.getenv("PYTORCH_VERSION") + +# dev_requirements = read_requirements("dev-requirements.txt") +# dev_requirements.append(pytorch_dep) -requirements = [ - pytorch_dep, -] setup( name=package_name, @@ -128,7 +129,6 @@ def get_extensions(): "torchao.kernel.configs": ["*.pkl"], }, ext_modules=get_extensions() if use_cpp != "0" else None, - install_requires=requirements, extras_require={"dev": read_requirements("dev-requirements.txt")}, description="Package for applying ao techniques to GPU models", long_description=open("README.md").read(), From ea04edd31dd9812f35cf820c2156a03664bd8776 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 26 Jun 2024 17:41:23 -0700 Subject: [PATCH 02/10] push --- setup.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/setup.py b/setup.py index 365dbb47e2..f2c1a2df01 100644 --- a/setup.py +++ b/setup.py @@ -111,15 +111,6 @@ def get_extensions(): return ext_modules -# Mimic code from torchvision https://github.com/pytorch/vision/blob/143d078b28f00471156a4e562dd3836370acc9ee/setup.py#L58 -# pytorch_dep = "torch" -# if os.getenv("PYTORCH_VERSION"): -# pytorch_dep += "==" + os.getenv("PYTORCH_VERSION") - -# dev_requirements = read_requirements("dev-requirements.txt") -# dev_requirements.append(pytorch_dep) - - setup( name=package_name, version=version+version_suffix, From 82e651955dde7a7d9855875e37e2766890be952e Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 26 Jun 2024 17:43:02 -0700 Subject: [PATCH 03/10] push --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index f2c1a2df01..fc85dcea9c 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,6 @@ # LICENSE file in the root directory of this source tree. import os -os.system("pip install torch") import glob from datetime import datetime From bbd36991f53fd58c77259b2c54b5984f2c1da813 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 26 Jun 2024 17:43:48 -0700 Subject: [PATCH 04/10] push --- .github/workflows/regression_test.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/regression_test.yml b/.github/workflows/regression_test.yml index 50e683e64c..21ad6535a3 100644 --- a/.github/workflows/regression_test.yml +++ b/.github/workflows/regression_test.yml @@ -65,14 +65,7 @@ jobs: yum install -y devtoolset-10-binutils export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH python -m pip install --upgrade pip - PYTORCH_VERSION=${{ env.PYTORCH_VERSION }} - if [ -z "$PYTORCH_VERSION" ]; then - PYTORCH_DEP="torch" - else - PYTORCH_DEP="torch==$PYTORCH_VERSION" - fi - echo "Installing PyTorch dependency: $PYTORCH_DEP" - pip install $PYTORCH_DEP + pip install ${{ matrix.torch-spec }} pip install -r dev-requirements.txt pip install . pytest test --verbose -s From a15d70d1447574251623acb9b620969462769dd9 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 26 Jun 2024 17:48:25 -0700 Subject: [PATCH 05/10] push --- .github/workflows/nightly_smoke_test.yml | 2 +- packaging/pre_build_script.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly_smoke_test.yml b/.github/workflows/nightly_smoke_test.yml index 33ba1e0925..05e5f16e18 100644 --- a/.github/workflows/nightly_smoke_test.yml +++ b/.github/workflows/nightly_smoke_test.yml @@ -39,7 +39,7 @@ jobs: else PYTORCH_DEP="torch==$PYTORCH_VERSION" fi - echo "Installing PyTorch dependency: $PYTORCH_DEP" + pip install $PYTORCH_DEP pip install -r dev-requirements.txt python setup.py install pytest test --verbose -s diff --git a/packaging/pre_build_script.sh b/packaging/pre_build_script.sh index 4bbd09694a..a03e863c5c 100644 --- a/packaging/pre_build_script.sh +++ b/packaging/pre_build_script.sh @@ -9,4 +9,13 @@ set -eux echo "This script is run before building torchao binaries" +python -m pip install --upgrade pip +PYTORCH_VERSION=${{ env.PYTORCH_VERSION }} +if [ -z "$PYTORCH_VERSION" ]; then + PYTORCH_DEP="torch" +else + PYTORCH_DEP="torch==$PYTORCH_VERSION" +fi +pip install $PYTORCH_DEP + pip install setuptools wheel twine auditwheel From 58b131246dbe116d692212c3147af100f9e2939d Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 26 Jun 2024 17:49:38 -0700 Subject: [PATCH 06/10] push --- .github/workflows/nightly_smoke_test.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/nightly_smoke_test.yml b/.github/workflows/nightly_smoke_test.yml index 05e5f16e18..eda94e659c 100644 --- a/.github/workflows/nightly_smoke_test.yml +++ b/.github/workflows/nightly_smoke_test.yml @@ -32,14 +32,7 @@ jobs: gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} script: | - python -m pip install --upgrade pip - PYTORCH_VERSION=${{ env.PYTORCH_VERSION }} - if [ -z "$PYTORCH_VERSION" ]; then - PYTORCH_DEP="torch" - else - PYTORCH_DEP="torch==$PYTORCH_VERSION" - fi - pip install $PYTORCH_DEP + pip install ${{ matrix.torch-spec }} pip install -r dev-requirements.txt python setup.py install pytest test --verbose -s From 7b21611e84cafa002abbeef70db95e3232d61259 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 26 Jun 2024 17:49:54 -0700 Subject: [PATCH 07/10] push --- .github/workflows/nightly_smoke_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly_smoke_test.yml b/.github/workflows/nightly_smoke_test.yml index eda94e659c..1b0026c63c 100644 --- a/.github/workflows/nightly_smoke_test.yml +++ b/.github/workflows/nightly_smoke_test.yml @@ -32,6 +32,7 @@ jobs: gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} script: | + python -m pip install --upgrade pip pip install ${{ matrix.torch-spec }} pip install -r dev-requirements.txt python setup.py install From d2df46df0e99a81551832b63316e571bbdb093cc Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 26 Jun 2024 18:22:43 -0700 Subject: [PATCH 08/10] Update pre_build_script.sh --- packaging/pre_build_script.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/packaging/pre_build_script.sh b/packaging/pre_build_script.sh index a03e863c5c..1690c62750 100644 --- a/packaging/pre_build_script.sh +++ b/packaging/pre_build_script.sh @@ -10,7 +10,6 @@ set -eux echo "This script is run before building torchao binaries" python -m pip install --upgrade pip -PYTORCH_VERSION=${{ env.PYTORCH_VERSION }} if [ -z "$PYTORCH_VERSION" ]; then PYTORCH_DEP="torch" else From 395d94986f586fcfe602376621bbdcf0713b2d52 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Thu, 27 Jun 2024 07:54:11 -0700 Subject: [PATCH 09/10] Update version.txt --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 0d91a54c7d..9e11b32fca 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.3.0 +0.3.1 From 94169bc56b9fd5284f5556e783561f32aaf862cc Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Thu, 27 Jun 2024 08:35:10 -0700 Subject: [PATCH 10/10] push --- torchao/prototype/mx_formats/custom_cast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchao/prototype/mx_formats/custom_cast.py b/torchao/prototype/mx_formats/custom_cast.py index 00082acad9..381f91c4a6 100644 --- a/torchao/prototype/mx_formats/custom_cast.py +++ b/torchao/prototype/mx_formats/custom_cast.py @@ -15,7 +15,7 @@ # TODO(future): if needed, make the below work on previous PyTorch versions, # just need to hunt down the previous location of `libdevice`. An assert # at the callsite prevents usage of this on unsupported versions. -if TORCH_VERSION_AFTER_2_4: +if TORCH_VERSION_AFTER_2_4 and has_triton(): from torch._inductor.runtime.triton_helpers import libdevice from torchao.prototype.mx_formats.constants import (