Skip to content

Commit

Permalink
#8027: move python_env creation to create_venv.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
vtangTT committed May 16, 2024
1 parent 44e0090 commit 09800db
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
20 changes: 1 addition & 19 deletions build_metal.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash
set -eo pipefail

if [ -z "$PYTHON_ENV_DIR" ]; then
PYTHON_ENV_DIR=$(pwd)/python_env
fi

if [ -z "$CONFIG" ]; then
echo "Build type defaulted to Release"
else
Expand All @@ -21,21 +17,7 @@ echo "Building tt-metal"
cmake -B build -G Ninja
cmake --build build --target install

echo "Creating virtual env in: $PYTHON_ENV_DIR"
python3 -m venv $PYTHON_ENV_DIR

source $PYTHON_ENV_DIR/bin/activate

echo "Setting up virtual env"
python3 -m pip config set global.extra-index-url https://download.pytorch.org/whl/cpu
python3 -m pip install setuptools wheel

echo "Installing dev dependencies"
python3 -m pip install -r $(pwd)/tt_metal/python_env/requirements-dev.txt

echo "Installing tt-metal"
pip install -e .
pip install -e ttnn
./scripts/build_scripts/create_venv.sh

if [ "$CONFIG" != "ci" ]; then
echo "Building cpp tests"
Expand Down
7 changes: 4 additions & 3 deletions scripts/build_scripts/build_with_profiler_opt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fi

remove_default_log_locations

cmake -B build && cmake --build build --target clean && rm -rf build
PYTHON_ENV_DIR=$(pwd)/build/python_env ENABLE_TRACY=1 ENABLE_PROFILER=1 ./build_metal.sh
cmake --build build --target programming_examples -- -j`nproc`
ENABLE_TRACY=1 ENABLE_PROFILER=1 cmake -B build -G Ninja && cmake --build build --target clean
cmake --build build --target install
cmake --build build --target programming_examples
PYTHON_ENV_DIR=$(pwd)/build/python_env ./scripts/build_scripts/create_venv.sh
23 changes: 23 additions & 0 deletions scripts/build_scripts/create_venv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

#!/bin/bash
set -eo pipefail

if [ -z "$PYTHON_ENV_DIR" ]; then
PYTHON_ENV_DIR=$(pwd)/python_env
fi

echo "Creating virtual env in: $PYTHON_ENV_DIR"
python3 -m venv $PYTHON_ENV_DIR

source $PYTHON_ENV_DIR/bin/activate

echo "Setting up virtual env"
python3 -m pip config set global.extra-index-url https://download.pytorch.org/whl/cpu
python3 -m pip install setuptools wheel

echo "Installing dev dependencies"
python3 -m pip install -r $(pwd)/tt_metal/python_env/requirements-dev.txt

echo "Installing tt-metal"
pip install -e .
pip install -e ttnn

0 comments on commit 09800db

Please sign in to comment.