Skip to content

Improve Quantization Setup Prompts and Doc #1537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/quantization.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clone_torchao is called as part of the install_requirements, so it might be better for us to remind users to call that first

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.
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions torchchat/utils/scripts/build_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: don't need to specify bash

exit 1
fi

Expand Down
6 changes: 6 additions & 0 deletions torchchat/utils/scripts/build_torchao_ops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading