You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[executorch][PR] add cuda backend to backend test infra
Pull Request resolved: #17873
Integrate cuda backend into backend test infra; skipped the unsupported test for now
ghstack-source-id: 349802496
@exported-using-ghexport
Differential Revision: [D93019490](https://our.internmc.facebook.com/intern/diff/D93019490/)
Copy file name to clipboardExpand all lines: .ci/scripts/test_backend.sh
+34-6Lines changed: 34 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ echo "Running backend test job for suite $SUITE, flow $FLOW."
17
17
echo"Saving job artifacts to $ARTIFACT_DIR."
18
18
19
19
eval"$(conda shell.bash hook)"
20
-
CONDA_ENV=$(conda env list --json |jq -r ".envs | .[-1]")
20
+
CONDA_ENV=$(conda env list --json |python -c "import sys, json; print(json.load(sys.stdin)['envs'][-1])")
21
21
conda activate "${CONDA_ENV}"
22
22
23
23
if [[ "$(uname)"=="Darwin" ]];then
@@ -56,6 +56,32 @@ if [[ "$FLOW" == *vulkan* ]]; then
56
56
EXTRA_BUILD_ARGS+=" -DEXECUTORCH_BUILD_VULKAN=ON"
57
57
fi
58
58
59
+
if [[ "$FLOW"==*cuda* ]];then
60
+
# When running with the PyTorch test-infra Docker image (which has nvcc),
61
+
# install executorch directly — it will auto-detect CUDA and install
62
+
# CUDA-enabled PyTorch. Skip setup-linux.sh which expects the custom
63
+
# Docker image with pre-built pinned-commit torch.
64
+
echo"Installing ExecuTorch with CUDA support..."
65
+
./install_executorch.sh --editable
66
+
67
+
# Verify PyTorch was installed with CUDA support
68
+
python -c "import torch; assert torch.cuda.is_available(), 'PyTorch CUDA not available after reinstall'; print(f'PyTorch {torch.__version__} with CUDA {torch.version.cuda}')"|| {
69
+
echo"ERROR: PyTorch was not installed with CUDA support"
70
+
exit 1
71
+
}
72
+
73
+
# Fix libstdc++ GLIBCXX version for CUDA backend.
74
+
# The embedded .so files in the CUDA blob require GLIBCXX_3.4.30
75
+
# which the default conda libstdc++ doesn't have.
76
+
echo"Installing newer libstdc++ for CUDA backend..."
0 commit comments