[CI] Add functorch testing shard (#81283)
- Adds `functorch` pinned hash to the repo
- Adds `functorch` shard to `linux-bionic-py3.7-clang9`
- Adds `checkout_install_functorch` to `.jenkins/pytorch/common_utils.sh`
- Invokes this function during the test shard of functorch
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81283
Approved by: https://github.com/zou3519
diff --git a/.github/ci_commit_pins/functorch.txt b/.github/ci_commit_pins/functorch.txt
new file mode 100644
index 0000000..9439830
--- /dev/null
+++ b/.github/ci_commit_pins/functorch.txt
@@ -0,0 +1 @@
+eace82adae308ae779a25d3d1579b5814369ae92
diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml
index db94a92..c2175fa 100644
--- a/.github/workflows/pull.yml
+++ b/.github/workflows/pull.yml
@@ -135,6 +135,7 @@
{ config: "crossref", shard: 2, num_shards: 2, runner: "linux.2xlarge" },
{ config: "dynamo", shard: 1, num_shards: 2, runner: "linux.2xlarge" },
{ config: "dynamo", shard: 2, num_shards: 2, runner: "linux.2xlarge" },
+ { config: "functorch", shard: 1, num_shards: 1, runner: "linux.2xlarge" },
]}
linux-bionic-cuda11_3-py3_7-clang9-build:
diff --git a/.jenkins/pytorch/common_utils.sh b/.jenkins/pytorch/common_utils.sh
index 16781e6..733519d 100644
--- a/.jenkins/pytorch/common_utils.sh
+++ b/.jenkins/pytorch/common_utils.sh
@@ -139,6 +139,18 @@
popd
}
+function checkout_install_functorch() {
+ local commit
+ commit=$(get_pinned_commit functorch)
+ pushd ..
+ git clone https://github.com/pytorch/functorch
+ pushd functorch
+ git checkout "${commit}"
+ time python setup.py develop
+ popd
+ popd
+}
+
function print_sccache_stats() {
echo 'PyTorch Build Statistics'
sccache --show-stats
diff --git a/.jenkins/pytorch/test.sh b/.jenkins/pytorch/test.sh
index 3bfd21c..f73aba5 100755
--- a/.jenkins/pytorch/test.sh
+++ b/.jenkins/pytorch/test.sh
@@ -585,6 +585,12 @@
popd
}
+test_functorch() {
+ pushd ../functorch
+ pytest test
+ popd
+}
+
test_torch_deploy() {
python torch/csrc/deploy/example/generate_examples.py
ln -sf "$TORCH_LIB_DIR"/libtorch* "$TORCH_BIN_DIR"
@@ -665,6 +671,9 @@
test_libtorch
elif [[ "${TEST_CONFIG}" = docs_test ]]; then
test_docs_test
+elif [[ "${TEST_CONFIG}" == *functorch* ]]; then
+ checkout_install_functorch
+ test_functorch
else
install_torchvision
install_torchdynamo