Skip to content

Commit d22dd4a

Browse files
committed
fix
1 parent 94c24e7 commit d22dd4a

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

.ci/scripts/test_wheel_package_qnn.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ PYTHON_VERSION=$1
9898
# Check wheel does NOT contain qualcomm/sdk
9999
# ----------------------------
100100
echo "Checking wheel does not contain qualcomm/sdk..."
101-
SDK_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep "executorch/backends/qualcomm/sdk" || true)
101+
SDK_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep -E "executorch/backends/qualcomm/sdk" || true)
102102
if [ -n "$SDK_FILES" ]; then
103103
echo "ERROR: Wheel package contains unexpected qualcomm/sdk files:"
104104
echo "$SDK_FILES"
@@ -111,7 +111,7 @@ fi
111111
# Check .so files in the wheel
112112
# ----------------------------
113113
echo "Checking for .so files inside the wheel..."
114-
WHEEL_SO_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep "executorch/backends/qualcomm/python" || true)
114+
WHEEL_SO_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep -E "executorch/backends/qualcomm/python" || true)
115115
if [ -z "$WHEEL_SO_FILES" ]; then
116116
echo "ERROR: No .so files found in wheel under executorch/backends/qualcomm/python"
117117
exit 1
@@ -139,12 +139,29 @@ run_core_tests () {
139139
echo "=== [$LABEL] Installing wheel & deps ==="
140140
"$PIPBIN" install --upgrade pip
141141
"$PIPBIN" install "$WHEEL_FILE"
142+
TORCH_VERSION=$(
143+
"$PYBIN" - <<'PY'
144+
import re, pathlib
145+
txt = pathlib.Path("install_requirements.py").read_text()
146+
print(re.search(r'TORCH_VERSION\s*=\s*["\']([^"\']+)["\']', txt).group(1))
147+
PY
148+
)
149+
150+
NIGHTLY_VERSION=$(
151+
"$PYBIN" - <<'PY'
152+
import re, pathlib
153+
txt = pathlib.Path("install_requirements.py").read_text()
154+
print(re.search(r'NIGHTLY_VERSION\s*=\s*["\']([^"\']+)["\']', txt).group(1))
155+
PY
156+
)
157+
echo "=== [$LABEL] Install torch==${TORCH_VERSION}.${NIGHTLY_VERSION} ==="
142158

143-
NIGHTLY_VERSION=$(python -c 'import re; txt=open("install_requirements.py").read(); print(re.search(r"NIGHTLY_VERSION\s*=\s*[\"\']([^\"\']+)[\"\']", txt).group(1))')
159+
# Install torchao based on the pinned PyTorch version
160+
"$PIPBIN" install torch=="${TORCH_VERSION}.${NIGHTLY_VERSION}" --index-url "https://download.pytorch.org/whl/nightly/cpu"
144161

145-
"$PIPBIN" install torch=="2.10.0.${NIGHTLY_VERSION}" --index-url "https://download.pytorch.org/whl/nightly/cpu"
146-
pushd "$REPO_ROOT" / third-party/ao > /dev/null
147-
USE_CPP=0 python setup.py develop
162+
# Install torchao based on the pinned commit from third-party/ao submodule
163+
pushd "$REPO_ROOT/third-party/ao" > /dev/null
164+
USE_CPP=0 "$PYBIN" setup.py develop
148165
popd > /dev/null
149166

150167
echo "=== [$LABEL] Import smoke tests ==="

0 commit comments

Comments
 (0)