@@ -27,14 +27,24 @@ function find_cmake_prefix_path() {
2727 MY_CMAKE_PREFIX_PATH=$path
2828}
2929
30+
31+ function get_executorch_commit_hash_pin() {
32+ # Assuming inside executorch
33+ nightly_str=$( cat ${TORCHCHAT_ROOT} /install/.pins/et-pin.txt)
34+ nightly_commit_hash=$( git log origin/nightly --format=%H --grep=" ${nightly_str} nightly release" )
35+ echo " Nightly commit hash: ${nightly_commit_hash} "
36+ }
37+
3038clone_executorch_internal () {
3139 rm -rf ${TORCHCHAT_ROOT} /${ET_BUILD_DIR} /src
3240
3341 mkdir -p ${TORCHCHAT_ROOT} /${ET_BUILD_DIR} /src
3442 pushd ${TORCHCHAT_ROOT} /${ET_BUILD_DIR} /src
3543 git clone https://github.com/pytorch/executorch.git
3644 cd executorch
37- git checkout $( cat ${TORCHCHAT_ROOT} /install/.pins/et-pin.txt)
45+ get_executorch_commit_hash_pin
46+
47+ git checkout " $nightly_commit_hash "
3848 echo " Install ExecuTorch: submodule update"
3949 git submodule sync
4050 git submodule update --init
@@ -60,9 +70,9 @@ clone_executorch() {
6070
6171 # Check if the version is the same
6272 current_version=$( git rev-parse HEAD)
63- desired_version= $( cat ${TORCHCHAT_ROOT} /install/.pins/et-pin.txt )
73+ get_executorch_commit_hash_pin
6474
65- if [ " $current_version " == " $desired_version " ]; then
75+ if [ " $current_version " == " $nightly_commit_hash " ]; then
6676 echo " ExecuTorch is already cloned with the correct version. Skipping clone."
6777 popd
6878 return
@@ -77,31 +87,16 @@ clone_executorch() {
7787
7888
7989install_executorch_python_libs () {
80- if [ ! -d " ${TORCHCHAT_ROOT} /${ET_BUILD_DIR} " ]; then
81- echo " Directory ${TORCHCHAT_ROOT} /${ET_BUILD_DIR} does not exist."
82- echo " Make sure you run clone_executorch"
83- exit 1
84- fi
85- pushd ${TORCHCHAT_ROOT} /${ET_BUILD_DIR} /src
86- cd executorch
87-
88- echo " Building and installing python libraries"
89- if [ " ${ENABLE_ET_PYBIND} " = false ]; then
90- echo " Not installing pybind"
91- bash ./install_requirements.sh
92- else
93- echo " Installing pybind"
94- bash ./install_requirements.sh --pybind xnnpack
95- fi
96-
90+ NIGHTLY=$( cat ${TORCHCHAT_ROOT} /install/.pins/et-pin.txt | tr -d " -" )
91+ echo " Installing ExecuTorch nightly 0.5.0.dev${NIGHTLY} "
92+ pip install executorch==" 0.5.0.dev${NIGHTLY} " --extra-index-url https://download.pytorch.org/whl/nightly/cpu
9793 # TODO: figure out the root cause of 'AttributeError: module 'evaluate'
9894 # has no attribute 'utils'' error from evaluate CI jobs and remove
9995 # `import lm_eval` from torchchat.py since it requires a specific version
10096 # of numpy.
10197 pip install numpy==' 1.26.4'
10298
103- pip3 list
104- popd
99+ pip list
105100}
106101
107102COMMON_CMAKE_ARGS=" \
0 commit comments