Skip to content

Commit 052fbc7

Browse files
authored
Fix FSDP venv python version
1 parent 34cf245 commit 052fbc7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

3.test_cases/pytorch/FSDP/slurm/create_venv.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@ set -ex
44
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
# SPDX-License-Identifier: MIT-0
66

7-
PYTHON_VERSION=$(python3 --version | awk '{print $2}' | awk -F'.' '{print $1"."$2}')
7+
PYTHON_V=python3
8+
OS_VERSION=$(cat /etc/os-release | grep VERSION_ID | awk -F '=' '{print $2}')
9+
OS_VERSION=${OS_VERSION//\"/}
10+
11+
if [ $OS_VERSION = "20.04" ]; then
12+
13+
PYTHON_VERSION=$(python3.9 --version | awk '{print $2}' | awk -F'.' '{print $1"."$2}')
14+
PYTHON_V=python3.9
15+
else
16+
PYTHON_VERSION=$(python3 --version | awk '{print $2}' | awk -F'.' '{print $1"."$2}')
17+
fi
18+
819
sudo apt install -y python$PYTHON_VERSION-venv
920

1021
# Create and actiate Python virtual environment
11-
python3 -m venv env
22+
$PYTHON_V -m venv env
1223
source ./env/bin/activate
1324

1425
pip install -r ../src/requirements.txt

0 commit comments

Comments
 (0)