2020-07-02 01:44:19 +00:00
|
|
|
local base = import 'templates/base.libsonnet';
|
|
|
|
local tpus = import 'templates/tpus.libsonnet';
|
|
|
|
local utils = import "templates/utils.libsonnet";
|
|
|
|
|
|
|
|
local tputests = base.BaseTest {
|
|
|
|
frameworkPrefix: 'pl',
|
|
|
|
modelName: 'tpu-tests',
|
|
|
|
mode: 'postsubmit',
|
|
|
|
configMaps: [],
|
|
|
|
|
2022-07-27 15:40:40 +00:00
|
|
|
timeout: 6000, # 100 minutes, in seconds.
|
2020-07-02 01:44:19 +00:00
|
|
|
|
2021-07-19 14:13:21 +00:00
|
|
|
image: 'pytorchlightning/pytorch_lightning',
|
|
|
|
imageTag: 'base-xla-py{PYTHON_VERSION}-torch{PYTORCH_VERSION}',
|
2020-07-02 01:44:19 +00:00
|
|
|
|
|
|
|
tpuSettings+: {
|
2021-07-19 14:13:21 +00:00
|
|
|
softwareVersion: 'pytorch-{PYTORCH_VERSION}',
|
2020-07-02 01:44:19 +00:00
|
|
|
},
|
|
|
|
accelerator: tpus.v3_8,
|
|
|
|
|
|
|
|
command: utils.scriptCommand(
|
|
|
|
|||
|
2022-10-03 13:13:33 +00:00
|
|
|
set +x # turn off tracing, spammy
|
|
|
|
set -e # exit on error
|
|
|
|
|
2021-07-19 14:13:21 +00:00
|
|
|
source ~/.bashrc
|
|
|
|
conda activate lightning
|
2022-10-03 13:13:33 +00:00
|
|
|
|
|
|
|
echo "--- Fetch the SHA's changes ---"
|
|
|
|
git clone --single-branch --depth 1 https://github.com/Lightning-AI/lightning.git /home/runner/work/lightning
|
|
|
|
cd home/runner/work/lightning
|
|
|
|
git fetch origin --depth 1 pull/{PR_NUMBER}/head:test/{PR_NUMBER}
|
|
|
|
git -c advice.detachedHead=false checkout {SHA}
|
|
|
|
|
|
|
|
echo "--- Install PL ---"
|
|
|
|
PACKAGE_NAME=pytorch FREEZE_REQUIREMENTS=1 pip install -e .[test]
|
|
|
|
pip list
|
|
|
|
|
2021-07-19 14:13:21 +00:00
|
|
|
echo $KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS
|
|
|
|
export XRT_TPU_CONFIG="tpu_worker;0;${KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS:7}"
|
2022-10-03 13:13:33 +00:00
|
|
|
|
|
|
|
echo "--- Running Lite tests ---"
|
|
|
|
cd tests/tests_lite
|
|
|
|
PL_RUN_TPU_TESTS=1 coverage run --source=lightning_lite -m pytest -vv --durations=0 ./
|
|
|
|
|
|
|
|
echo "--- Running standalone Lite tests ---"
|
|
|
|
PL_STANDALONE_TESTS_SOURCE=lightning_lite PL_STANDALONE_TESTS_BATCH_SIZE=1 bash run_standalone_tests.sh
|
|
|
|
|
|
|
|
echo "--- Running PL tests ---"
|
|
|
|
cd ../tests_pytorch
|
|
|
|
PL_RUN_TPU_TESTS=1 coverage run --source=pytorch_lightning -m pytest -vv --durations=0 ./
|
|
|
|
|
|
|
|
echo "--- Running standalone PL tests ---"
|
|
|
|
PL_STANDALONE_TESTS_SOURCE=pytorch_lightning PL_STANDALONE_TESTS_BATCH_SIZE=1 bash run_standalone_tests.sh
|
|
|
|
|
|
|
|
echo "--- Generating coverage ---"
|
2020-07-02 01:44:19 +00:00
|
|
|
coverage xml
|
|
|
|
cat coverage.xml | tr -d '\t'
|
|
|
|
|||
|
|
|
|
),
|
|
|
|
};
|
|
|
|
|
|
|
|
tputests.oneshotJob
|