Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 68cdec6

Browse files
committed
update torchao library name
1 parent 62c1b7a commit 68cdec6

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

runner/aoti.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ if(Torch_FOUND)
3030
endif()
3131

3232
if (LINK_TORCHAO_CUSTOM_OPS)
33-
target_link_libraries(aoti_run "${TORCHCHAT_ROOT}/torchao-build/cmake-out/liblowbit_op_aten${CMAKE_SHARED_LIBRARY_SUFFIX}")
33+
target_link_libraries(aoti_run "${TORCHCHAT_ROOT}/torchao-build/cmake-out/ops/linear/linear_a8wxdq_op/liblinear_a8wxdq_aten${CMAKE_SHARED_LIBRARY_SUFFIX}")
3434
endif()

runner/et.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ if(executorch_FOUND)
112112
endif()
113113

114114
if(LINK_TORCHAO_CUSTOM_OPS)
115-
target_link_libraries(et_run PRIVATE "${TORCHCHAT_ROOT}/torchao-build/cmake-out/liblowbit_op_executorch${CMAKE_SHARED_LIBRARY_SUFFIX}")
115+
target_link_libraries(et_run PRIVATE "${TORCHCHAT_ROOT}/torchao-build/cmake-out/ops/linear/linear_a8wxdq_op/liblinear_a8wxdq_aten${CMAKE_SHARED_LIBRARY_SUFFIX}")
116116
endif()
117117

118118
# Adding target_link_options_shared_lib as commented out below leads to this:

torchchat/utils/quantize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ def quantized_model(self) -> nn.Module:
891891
# Try loading custom op
892892
try:
893893
import glob
894-
libs = glob.glob(f"{torchao_build_path}/cmake-out/liblowbit_op_aten.*")
894+
libs = glob.glob(f"{torchao_build_path}/cmake-out/ops/linear/linear_a8wxdq_op/liblinear_a8wxdq_aten.*")
895895
libs = list(filter(lambda l: (l.endswith("so") or l.endswith("dylib")), libs))
896896
torch.ops.load_library(libs[0])
897897
except Exception as e:

torchchat/utils/scripts/install_utils.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,30 +180,31 @@ clone_torchao() {
180180

181181
install_torchao_custom_aten_ops() {
182182
echo "Building torchao custom ops for ATen"
183-
pushd ${TORCHCHAT_ROOT}/torchao-build/src/ao/torchao/experimental/kernels/cpu/linear/examples/torch_custom_op
184-
export TORCHAO_INCLUDE_DIRS=${TORCHCHAT_ROOT}/torchao-build/src/ao
183+
pushd ${TORCHCHAT_ROOT}/torchao-build/src/ao/torchao/experimental
185184

186185
CMAKE_OUT_DIR=${TORCHCHAT_ROOT}/torchao-build/cmake-out
187-
cmake -DTORCHAO_INCLUDE_DIRS=${TORCHAO_INCLUDE_DIRS} \
188-
-DCMAKE_PREFIX_PATH=${MY_CMAKE_PREFIX_PATH} \
189-
-DPLATFORM="ATEN" \
186+
cmake -DCMAKE_PREFIX_PATH=${MY_CMAKE_PREFIX_PATH} \
187+
-DTORCHAO_OP_TARGET="ATEN" \
190188
-S . \
191189
-B ${CMAKE_OUT_DIR} -G Ninja
192190
cmake --build ${CMAKE_OUT_DIR}
191+
192+
popd
193193
}
194194

195195
install_torchao_custom_executorch_ops() {
196196
echo "Building torchao custom ops for ExecuTorch"
197-
pushd ${TORCHCHAT_ROOT}/torchao-build/src/ao/torchao/experimental/kernels/cpu/linear/examples/torch_custom_op
197+
pushd ${TORCHCHAT_ROOT}/torchao-build/src/ao/torchao/experimental
198198
export TORCHAO_INCLUDE_DIRS=${TORCHCHAT_ROOT}/torchao-build/src/ao
199199

200200
CMAKE_OUT_DIR="${TORCHCHAT_ROOT}/torchao-build/cmake-out"
201-
cmake -DTORCHAO_INCLUDE_DIRS=${TORCHAO_INCLUDE_DIRS} \
202-
-DCMAKE_PREFIX_PATH=${MY_CMAKE_PREFIX_PATH} \
201+
cmake -DCMAKE_PREFIX_PATH=${MY_CMAKE_PREFIX_PATH} \
203202
-DEXECUTORCH_INCLUDE_DIRS=${EXECUTORCH_INCLUDE_DIRS} \
204203
-DEXECUTORCH_LIBRARIES=${EXECUTORCH_LIBRARIES} \
205-
-DPLATFORM="EXECUTORCH" \
204+
-DTORCHAO_OP_TARGET="EXECUTORCH" \
206205
-S . \
207206
-B ${CMAKE_OUT_DIR} -G Ninja
208207
cmake --build ${CMAKE_OUT_DIR}
208+
209+
popd
209210
}

0 commit comments

Comments
 (0)