Skip to content
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions .ci/scripts/test_wheel_package_qnn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ PYTHON_VERSION=$1
# Check wheel does NOT contain qualcomm/sdk
# ----------------------------
echo "Checking wheel does not contain qualcomm/sdk..."
SDK_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep "executorch/backends/qualcomm/sdk" || true)
SDK_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep -E "executorch/backends/qualcomm/sdk" || true)
if [ -n "$SDK_FILES" ]; then
echo "ERROR: Wheel package contains unexpected qualcomm/sdk files:"
echo "$SDK_FILES"
Expand All @@ -111,7 +111,7 @@ fi
# Check .so files in the wheel
# ----------------------------
echo "Checking for .so files inside the wheel..."
WHEEL_SO_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep "executorch/backends/qualcomm/python" || true)
WHEEL_SO_FILES=$(unzip -l "$WHEEL_FILE" | awk '{print $4}' | grep -E "executorch/backends/qualcomm/python" || true)
if [ -z "$WHEEL_SO_FILES" ]; then
echo "ERROR: No .so files found in wheel under executorch/backends/qualcomm/python"
exit 1
Expand Down Expand Up @@ -139,8 +139,30 @@ run_core_tests () {
echo "=== [$LABEL] Installing wheel & deps ==="
"$PIPBIN" install --upgrade pip
"$PIPBIN" install "$WHEEL_FILE"
"$PIPBIN" install torch=="2.9.0.dev20250906" --index-url "https://download.pytorch.org/whl/nightly/cpu"
"$PIPBIN" install --pre torchao --index-url "https://download.pytorch.org/whl/nightly/cpu"
TORCH_VERSION=$(
"$PYBIN" - <<'PY'
import re, pathlib
txt = pathlib.Path("torch_pin.py").read_text()
print(re.search(r'TORCH_VERSION\s*=\s*["\']([^"\']+)["\']', txt).group(1))
PY
)

NIGHTLY_VERSION=$(
"$PYBIN" - <<'PY'
import re, pathlib
txt = pathlib.Path("torch_pin.py").read_text()
print(re.search(r'NIGHTLY_VERSION\s*=\s*["\']([^"\']+)["\']', txt).group(1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you not just import torch_pin.py and get the TORCH_VERSION and NIGHTLY_VERSION from that instead of parsing the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

PY
)
echo "=== [$LABEL] Install torch==${TORCH_VERSION}.${NIGHTLY_VERSION} ==="

# Install torchao based on the pinned PyTorch version
"$PIPBIN" install torch=="${TORCH_VERSION}.${NIGHTLY_VERSION}" --index-url "https://download.pytorch.org/whl/nightly/cpu"

# Install torchao based on the pinned commit from third-party/ao submodule
pushd "$REPO_ROOT/third-party/ao" > /dev/null
USE_CPP=0 "$PYBIN" setup.py develop
popd > /dev/null

echo "=== [$LABEL] Import smoke tests ==="
"$PYBIN" -c "import executorch; print('executorch imported successfully')"
Expand Down
Loading