Skip to content

Commit 46f38a7

Browse files
committed
Skip conda install if intel
1 parent 454b3a6 commit 46f38a7

File tree

6 files changed

+23
-27
lines changed

6 files changed

+23
-27
lines changed

backend/python/common-env/transformers/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ ifeq ($(BUILD_TYPE), hipblas)
88
CONDA_ENV_PATH = "transformers-rocm.yml"
99
endif
1010

11+
ifneq (,$(findstring sycl,$(BUILD_TYPE)))
12+
export SKIP_CONDA=1
13+
endif
14+
1115
.PHONY: transformers
1216
transformers:
1317
@echo "Installing $(CONDA_ENV_PATH)..."

backend/python/common-env/transformers/install.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@ conda_env_exists(){
66
! conda list --name "${@}" >/dev/null 2>/dev/null
77
}
88

9-
if conda_env_exists "transformers" ; then
10-
echo "Creating virtual environment..."
11-
conda env create --name transformers --file $1
12-
echo "Virtual environment created."
13-
else
14-
echo "Virtual environment already exists."
9+
if [ $SKIP_CONDA == 1 ]; then
10+
echo "Skipping conda environment installation"
11+
else
12+
if conda_env_exists "transformers" ; then
13+
echo "Creating virtual environment..."
14+
conda env create --name transformers --file $1
15+
echo "Virtual environment created."
16+
else
17+
echo "Virtual environment already exists."
18+
fi
19+
fi
20+
21+
if [ -d "/opt/intel" ]; then
22+
# If the directory exists, we assume we are using the intel image
23+
# (no conda env)
24+
# https://github.com/intel/intel-extension-for-pytorch/issues/538
25+
pip install intel-extension-for-transformers
1526
fi
1627

1728
if [ "$PIP_CACHE_PURGE" = true ] ; then

backend/python/diffusers/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export CONDA_ENV_PATH = "diffusers-rocm.yml"
55
endif
66

77
ifneq (,$(findstring sycl,$(BUILD_TYPE)))
8-
export SKIP=1
8+
export SKIP_CONDA=1
99
endif
1010

1111
.PHONY: diffusers

backend/python/diffusers/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ conda_env_exists(){
66
! conda list --name "${@}" >/dev/null 2>/dev/null
77
}
88

9-
if [ $SKIP == 1 ]; then
9+
if [ $SKIP_CONDA == 1 ]; then
1010
echo "Skipping conda environment installation"
1111
else
1212
if conda_env_exists "diffusers" ; then

backend/python/transformers/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.PHONY: transformers
22
transformers:
33
$(MAKE) -C ../common-env/transformers
4-
bash install.sh
54

65
.PHONY: run
76
run:

backend/python/transformers/install.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)