-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update * param * Apply suggestions from code review (cherry picked from commit 77006a2)
- Loading branch information
Showing
5 changed files
with
100 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
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: [], | ||
|
||
timeout: 6000, # 100 minutes, in seconds. | ||
|
||
image: 'pytorchlightning/pytorch_lightning', | ||
imageTag: 'base-xla-py{PYTHON_VERSION}-torch{PYTORCH_VERSION}', | ||
|
||
tpuSettings+: { | ||
softwareVersion: 'pytorch-{PYTORCH_VERSION}', | ||
}, | ||
accelerator: tpus.v3_8, | ||
|
||
command: utils.scriptCommand( | ||
||| | ||
set +x # turn off tracing, spammy | ||
set -e # exit on error | ||
source ~/.bashrc | ||
conda activate lightning | ||
echo "--- Cloning lightning repo ---" | ||
git clone --single-branch --depth 1 https://github.com/Lightning-AI/lightning.git | ||
cd lightning | ||
# PR triggered it, check it out | ||
if [ -n "{PR_NUMBER}" ]; then # if PR number is not empty | ||
echo "--- Fetch the PR changes ---" | ||
git fetch origin --depth 1 pull/{PR_NUMBER}/head:test/{PR_NUMBER} | ||
echo "--- Checkout PR changes ---" | ||
git -c advice.detachedHead=false checkout {SHA} | ||
fi | ||
echo "--- Install packages ---" | ||
PACKAGE_NAME=pytorch pip install .[dev] | ||
pip list | ||
echo $KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS | ||
export XRT_TPU_CONFIG="tpu_worker;0;${KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS:7}" | ||
echo "--- Sanity check TPU availability ---" | ||
python -c "from pytorch_lightning.accelerators import TPUAccelerator; assert TPUAccelerator.is_available()" | ||
echo "Sanity check passed!" | ||
echo "--- Running PL tests ---" | ||
cd tests/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 ---" | ||
coverage xml | ||
cat coverage.xml | tr -d '\t' | ||
||| | ||
), | ||
}; | ||
|
||
tputests.oneshotJob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters