diff --git a/docs/quantization.md b/docs/quantization.md index 79799f1ce..7d65190cf 100644 --- a/docs/quantization.md +++ b/docs/quantization.md @@ -149,6 +149,7 @@ From the torchchat root directory, run bash torchchat/utils/scripts/build_torchao_ops.sh ``` +Note that before running it, you must first clone torchao with `bash torchchat/utils/scripts/clone_torchao.sh` if you have not done so already. This should take about 10 seconds to complete. When building the AOTI and C++ runners, you must pass the flag link_torchao_ops when running the scripts the build the runners. @@ -161,7 +162,7 @@ bash torchchat/utils/scripts/build_native.sh aoti link_torchao_ops bash torchchat/utils/scripts/build_native.sh et link_torchao_ops ``` -Note before running `bash torchchat/utils/scripts/build_native.sh et link_torchao_ops`, you must first install executorch with `bash torchchat/utils/scripts/install_et.sh` if you have not done so already. +Note that before running `bash torchchat/utils/scripts/build_native.sh et link_torchao_ops`, you must first install executorch with `bash torchchat/utils/scripts/install_et.sh` if you have not done so already. ### Examples @@ -218,6 +219,7 @@ From the torchchat root directory, run ``` bash torchchat/utils/scripts/build_torchao_ops.sh mps ``` +Note that before running it, you must first clone torchao with `bash torchchat/utils/scripts/clone_torchao.sh` if you have not done so already. ### Examples diff --git a/torchchat/utils/scripts/build_native.sh b/torchchat/utils/scripts/build_native.sh index 0ba2f6858..afd877c60 100755 --- a/torchchat/utils/scripts/build_native.sh +++ b/torchchat/utils/scripts/build_native.sh @@ -70,14 +70,14 @@ git submodule sync if [[ "$TARGET" == "et" ]]; then if [ ! -d "${TORCHCHAT_ROOT}/${ET_BUILD_DIR}/install" ]; then echo "Directory ${TORCHCHAT_ROOT}/${ET_BUILD_DIR}/install does not exist." - echo "Make sure you run install_executorch_libs" + echo "Make sure you run bash torchchat/utils/scripts/install_et.sh" exit 1 fi if [[ "$LINK_TORCHAO_OPS" == "ON" ]]; then if [ ! -d "${TORCHCHAT_ROOT}/torchao-build" ]; then echo "Directory ${TORCHCHAT_ROOT}/torchao-build does not exist." - echo "Make sure you run clone_torchao" + echo "Make sure you run bash torchchat/utils/scripts/clone_torchao.sh" exit 1 fi diff --git a/torchchat/utils/scripts/build_torchao_ops.sh b/torchchat/utils/scripts/build_torchao_ops.sh index a8388d8d7..070954ff6 100644 --- a/torchchat/utils/scripts/build_torchao_ops.sh +++ b/torchchat/utils/scripts/build_torchao_ops.sh @@ -14,6 +14,12 @@ fi source "$(dirname "${BASH_SOURCE[0]}")/install_utils.sh" +if [ ! -d "${TORCHCHAT_ROOT}/torchao-build" ]; then + echo "Directory ${TORCHCHAT_ROOT}/torchao-build does not exist." + echo "Make sure you run bash torchchat/utils/scripts/clone_torchao.sh" + exit 1 +fi + pushd ${TORCHCHAT_ROOT} find_cmake_prefix_path install_torchao_aten_ops "$device"