Skip to content

Commit aa6fb70

Browse files
committed
up
1 parent a8106fd commit aa6fb70

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

install/install_torchao.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
9+
# USE_CPP=1 indicates that the torchao experimental aten kernels will be built and loaded
10+
# if on Mac with Apple Silicon
11+
12+
if [ -z "${PYTHON_EXECUTABLE:-}" ];
13+
then
14+
if [[ -z ${CONDA_DEFAULT_ENV:-} ]] || [[ ${CONDA_DEFAULT_ENV:-} == "base" ]] || [[ ! -x "$(command -v python)" ]];
15+
then
16+
PYTHON_EXECUTABLE=python3
17+
else
18+
PYTHON_EXECUTABLE=python
19+
fi
20+
fi
21+
echo "Using python executable: $PYTHON_EXECUTABLE"
22+
23+
if [[ "$PYTHON_EXECUTABLE" == "python" ]];
24+
then
25+
PIP_EXECUTABLE=pip
26+
elif [[ "$PYTHON_EXECUTABLE" == "python3" ]];
27+
then
28+
PIP_EXECUTABLE=pip3
29+
else
30+
PIP_EXECUTABLE=pip${PYTHON_SYS_VERSION}
31+
fi
32+
echo "Using pip executable: $PIP_EXECUTABLE"
33+
34+
35+
export TORCHAO_PIN=$(cat install/.pins/torchao-pin.txt)
36+
(
37+
set -x
38+
USE_CPP=1 $PIP_EXECUTABLE install git+https://github.com/pytorch/ao.git@${TORCHAO_PIN}
39+
)

0 commit comments

Comments
 (0)