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

Commit d1f9899

Browse files
committed
init
1 parent 0ddee99 commit d1f9899

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
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_OPS)
33-
target_link_libraries(aoti_run "${TORCHCHAT_ROOT}/torchao-build/cmake-out/lib/liblinear_a8wxdq_ATEN${CMAKE_SHARED_LIBRARY_SUFFIX}")
33+
target_link_libraries(aoti_run "${TORCHCHAT_ROOT}/torchao-build/cmake-out/lib/libtorchao_ops_aten${CMAKE_SHARED_LIBRARY_SUFFIX}")
3434
endif()

runner/et.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,9 @@ if(executorch_FOUND)
117117
endif()
118118

119119
if(LINK_TORCHAO_OPS)
120-
target_link_libraries(et_run PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,${TORCHCHAT_ROOT}/torchao-build/cmake-out/lib/liblinear_a8wxdq_EXECUTORCH.a>")
120+
target_link_libraries(et_run PRIVATE "$<LINK_LIBRARY:WHOLE_ARCHIVE,${TORCHCHAT_ROOT}/torchao-build/cmake-out/lib/libtorchao_ops_executorch.a>")
121121
target_link_libraries(et_run PRIVATE
122122
"${TORCHCHAT_ROOT}/torchao-build/cmake-out/lib/libtorchao_kernels_aarch64.a"
123-
"${TORCHCHAT_ROOT}/torchao-build/cmake-out/lib/libtorchao_ops_linear_EXECUTORCH.a"
124123
)
125124
endif()
126125

torchchat/utils/quantize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ def quantized_model(self) -> nn.Module:
898898
# Try loading custom op
899899
try:
900900
import glob
901-
libs = glob.glob(f"{torchao_build_path}/cmake-out/lib/liblinear_a8wxdq_ATEN.*")
901+
libs = glob.glob(f"{torchao_build_path}/cmake-out/lib/libtorchao_ops_aten.*")
902902
libs = list(filter(lambda l: (l.endswith("so") or l.endswith("dylib")), libs))
903903
torch.ops.load_library(libs[0])
904904
except Exception as e:

torchchat/utils/scripts/install_utils.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,10 @@ clone_torchao() {
176176
pushd ${TORCHCHAT_ROOT}/torchao-build/src
177177
echo $pwd
178178

179-
git clone https://github.com/pytorch/ao.git
180-
cd ao
181-
git checkout $(cat ${TORCHCHAT_ROOT}/install/.pins/torchao-pin.txt)
179+
# git clone https://github.com/pytorch/ao.git
180+
# cd ao
181+
# git checkout $(cat ${TORCHCHAT_ROOT}/install/.pins/torchao-pin.txt)
182+
cp -R $HOME/fbsource/fbcode/pytorch/ao .
182183

183184
popd
184185
}
@@ -191,7 +192,7 @@ install_torchao_aten_ops() {
191192
cmake -DCMAKE_PREFIX_PATH=${MY_CMAKE_PREFIX_PATH} \
192193
-DCMAKE_INSTALL_PREFIX=${CMAKE_OUT_DIR} \
193194
-DCMAKE_BUILD_TYPE="Release" \
194-
-DTORCHAO_OP_TARGET="ATEN" \
195+
-DTORCHAO_OP_TARGET="aten" \
195196
-S . \
196197
-B ${CMAKE_OUT_DIR} -G Ninja
197198
cmake --build ${CMAKE_OUT_DIR} --target install --config Release
@@ -207,7 +208,7 @@ install_torchao_executorch_ops() {
207208
cmake -DCMAKE_PREFIX_PATH=${MY_CMAKE_PREFIX_PATH} \
208209
-DCMAKE_INSTALL_PREFIX=${CMAKE_OUT_DIR} \
209210
-DCMAKE_BUILD_TYPE="Release" \
210-
-DTORCHAO_OP_TARGET="EXECUTORCH" \
211+
-DTORCHAO_OP_TARGET="executorch" \
211212
-DEXECUTORCH_INCLUDE_DIRS="${EXECUTORCH_INCLUDE_DIRS}" \
212213
-DEXECUTORCH_LIBRARIES="${EXECUTORCH_LIBRARIES}" \
213214
-S . \

0 commit comments

Comments
 (0)