Skip to content

Commit

Permalink
Patch test_quantized_aot_lib.sh in OSS (#2652)
Browse files Browse the repository at this point in the history
Summary:
Fix an error in #1562
Make sure [test_quantized_aot_lib.sh](https://github.com/pytorch/executorch/pull/2652/files#diff-50202debf18aa984fa36c1450a3dbb2726c76ea23fffbe5c6eef95ede61af9d4)
Correspond to internal fbcode version

Pull Request resolved: #2652

Reviewed By: shoumikhin

Differential Revision: D55323609

Pulled By: atalman

fbshipit-source-id: b8413b31a4119bf7a4afd70266a0a5301777ca0c
  • Loading branch information
atalman authored and facebook-github-bot committed Mar 25, 2024
1 parent e3cc1f4 commit 02050de
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .ci/scripts/test_quantized_aot_lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

set -exu

# shellcheck source=/dev/null
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

which "${PYTHON_EXECUTABLE}"
# Just set this variable here, it's cheap even if we use buck2
CMAKE_OUTPUT_DIR=cmake-out

build_cmake_quantized_aot_lib() {
echo "Building quantized aot lib"
SITE_PACKAGES="$(${PYTHON_EXECUTABLE} -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
CMAKE_PREFIX_PATH="${SITE_PACKAGES}/torch"
(rm -rf ${CMAKE_OUTPUT_DIR} \
&& mkdir ${CMAKE_OUTPUT_DIR} \
&& cd ${CMAKE_OUTPUT_DIR} \
&& retry cmake -DBUCK2=buck2 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
-DREGISTER_QUANTIZED_OPS=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)

cmake --build ${CMAKE_OUTPUT_DIR} -j4
}

build_cmake_quantized_aot_lib

0 comments on commit 02050de

Please sign in to comment.