From a6a039c8af7bf8e6afb370cac76f62edad777488 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 4 Mar 2024 19:36:52 +0100 Subject: [PATCH] Skip conda install if intel --- backend/python/common-env/transformers/Makefile | 4 ++++ .../python/common-env/transformers/install.sh | 16 ++++++++++------ backend/python/diffusers/Makefile | 2 +- backend/python/diffusers/install.sh | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/backend/python/common-env/transformers/Makefile b/backend/python/common-env/transformers/Makefile index 1cd71ab177d3..b81b1ad7550e 100644 --- a/backend/python/common-env/transformers/Makefile +++ b/backend/python/common-env/transformers/Makefile @@ -8,6 +8,10 @@ ifeq ($(BUILD_TYPE), hipblas) CONDA_ENV_PATH = "transformers-rocm.yml" endif +ifneq (,$(findstring sycl,$(BUILD_TYPE))) +export SKIP_CONDA=1 +endif + .PHONY: transformers transformers: @echo "Installing $(CONDA_ENV_PATH)..." diff --git a/backend/python/common-env/transformers/install.sh b/backend/python/common-env/transformers/install.sh index 42965bdbc68e..e9dd92dbbee1 100644 --- a/backend/python/common-env/transformers/install.sh +++ b/backend/python/common-env/transformers/install.sh @@ -6,12 +6,16 @@ conda_env_exists(){ ! conda list --name "${@}" >/dev/null 2>/dev/null } -if conda_env_exists "transformers" ; then - echo "Creating virtual environment..." - conda env create --name transformers --file $1 - echo "Virtual environment created." -else - echo "Virtual environment already exists." +if [ $SKIP_CONDA == 1 ]; then + echo "Skipping conda environment installation" +else + if conda_env_exists "transformers" ; then + echo "Creating virtual environment..." + conda env create --name transformers --file $1 + echo "Virtual environment created." + else + echo "Virtual environment already exists." + fi fi if [ "$PIP_CACHE_PURGE" = true ] ; then diff --git a/backend/python/diffusers/Makefile b/backend/python/diffusers/Makefile index df3ee4da9f04..a3901dafcaa1 100644 --- a/backend/python/diffusers/Makefile +++ b/backend/python/diffusers/Makefile @@ -5,7 +5,7 @@ export CONDA_ENV_PATH = "diffusers-rocm.yml" endif ifneq (,$(findstring sycl,$(BUILD_TYPE))) -export SKIP=1 +export SKIP_CONDA=1 endif .PHONY: diffusers diff --git a/backend/python/diffusers/install.sh b/backend/python/diffusers/install.sh index f4de8ae9bb6e..a95ba29e8d7f 100755 --- a/backend/python/diffusers/install.sh +++ b/backend/python/diffusers/install.sh @@ -6,7 +6,7 @@ conda_env_exists(){ ! conda list --name "${@}" >/dev/null 2>/dev/null } -if [ $SKIP == 1 ]; then +if [ $SKIP_CONDA == 1 ]; then echo "Skipping conda environment installation" else if conda_env_exists "diffusers" ; then