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-03-23 06:05:38 +00:00
|
|
|
timeout: 1200, # 20 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
|
|
|
|
conda activate lightning
|
|
|
|
mkdir -p /home/runner/work/pytorch-lightning && cd /home/runner/work/pytorch-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
|
|
|
|
git fetch origin "refs/pull/{PR_NUMBER}/head:pr/{PR_NUMBER}" && git checkout "pr/{PR_NUMBER}"
|
|
|
|
git checkout {SHA}
|
2022-06-29 13:35:57 +00:00
|
|
|
export PACKAGE_NAME=pytorch
|
|
|
|
export FREEZE_REQUIREMENTS=1
|
2021-07-19 14:13:21 +00:00
|
|
|
pip install -e .
|
|
|
|
echo $KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS
|
|
|
|
export XRT_TPU_CONFIG="tpu_worker;0;${KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS:7}"
|
2022-06-15 22:10:49 +00:00
|
|
|
cd tests/tests_pytorch
|
2022-07-11 17:25:32 +00:00
|
|
|
echo $PWD
|
2022-05-10 10:57:38 +00:00
|
|
|
# TODO (@kaushikb11): Add device stats tests here
|
2022-07-11 17:25:32 +00:00
|
|
|
coverage run --source pytorch_lightning -m pytest -v --capture=no \
|
2022-06-15 22:10:49 +00:00
|
|
|
strategies/test_tpu_spawn.py \
|
2022-06-22 14:57:19 +00:00
|
|
|
profilers/test_xla_profiler.py \
|
2022-06-15 22:10:49 +00:00
|
|
|
accelerators/test_tpu.py \
|
2022-06-22 08:57:50 +00:00
|
|
|
models/test_tpu.py \
|
2022-07-14 15:43:41 +00:00
|
|
|
plugins/environments/test_xla_environment.py \
|
|
|
|
utilities/test_xla_device_utils.py
|
2020-07-02 01:44:19 +00:00
|
|
|
test_exit_code=$?
|
|
|
|
echo "\n||| END PYTEST LOGS |||\n"
|
|
|
|
coverage xml
|
|
|
|
cat coverage.xml | tr -d '\t'
|
|
|
|
test $test_exit_code -eq 0
|
|
|
|
|||
|
|
|
|
),
|
|
|
|
};
|
|
|
|
|
|
|
|
tputests.oneshotJob
|