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(
|
|
|
|
|||
|
2021-07-19 14:13:21 +00:00
|
|
|
source ~/.bashrc
|
2022-08-31 11:38:54 +00:00
|
|
|
set -e
|
2021-07-19 14:13:21 +00:00
|
|
|
conda activate lightning
|
2022-08-30 19:17:38 +00:00
|
|
|
mkdir -p /home/runner/work/lightning && cd /home/runner/work/lightning
|
2022-06-15 23:33:43 +00:00
|
|
|
git clone https://github.com/Lightning-AI/lightning.git
|
2022-07-11 17:25:32 +00:00
|
|
|
cd lightning
|
2021-07-19 14:13:21 +00:00
|
|
|
echo $PWD
|
|
|
|
git ls-remote --refs origin
|
2022-09-12 15:25:54 +00:00
|
|
|
git fetch origin "refs/pull/{PR_NUMBER}/head"
|
2021-07-19 14:13:21 +00:00
|
|
|
git checkout {SHA}
|
2022-06-29 13:35:57 +00:00
|
|
|
export PACKAGE_NAME=pytorch
|
|
|
|
export FREEZE_REQUIREMENTS=1
|
2022-07-15 21:40:04 +00:00
|
|
|
pip install -e .[test]
|
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-07-27 15:40:40 +00:00
|
|
|
export PL_RUN_TPU_TESTS=1
|
2022-06-15 22:10:49 +00:00
|
|
|
cd tests/tests_pytorch
|
2022-07-27 15:40:40 +00:00
|
|
|
coverage run --source=pytorch_lightning -m pytest -vv --durations=0 ./
|
|
|
|
echo "\n||| Running standalone tests |||\n"
|
2022-09-01 22:13:12 +00:00
|
|
|
export PL_STANDALONE_TESTS_SOURCE=pytorch_lightning
|
2022-08-31 11:38:54 +00:00
|
|
|
export PL_STANDALONE_TESTS_BATCH_SIZE=1
|
2022-07-28 23:33:22 +00:00
|
|
|
bash run_standalone_tests.sh
|
2020-07-02 01:44:19 +00:00
|
|
|
echo "\n||| END PYTEST LOGS |||\n"
|
|
|
|
coverage xml
|
|
|
|
cat coverage.xml | tr -d '\t'
|
|
|
|
|||
|
|
|
|
),
|
|
|
|
};
|
|
|
|
|
|
|
|
tputests.oneshotJob
|