Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PT/XLA] Use new Ansible image for GPU tests #882

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions tests/pytorch/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,6 @@ local volumes = import 'templates/volumes.libsonnet';
PyTorchTest:: PyTorchBaseTest {
local config = self,

entrypoint: [
'bash',
'-cxue',
|||
if [[ ! -z "$(KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS)" ]]; then
# Trim grpc:// prefix
export XRT_TPU_CONFIG="tpu_worker;0;${KUBE_GOOGLE_CLOUD_TPU_ENDPOINTS:7}"
fi

# Run whatever is in `command` here
docker-entrypoint.sh "${@:0}"
|||,
],

volumeMap+: {
dshm: volumes.MemoryVolumeSpec {
name: 'dshm',
Expand Down
20 changes: 19 additions & 1 deletion tests/pytorch/nightly/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,24 @@ local volumes = import 'templates/volumes.libsonnet';
},
GpuMixin:: {
local config = self,
imageTag+: '_cuda_11.8',

# TODO: merge common setup with PyTorchTpuVmMixin
entrypoint: [
'bash',
'-cxue',
|||
git clone --depth=1 https://github.com/pytorch/pytorch.git
cd pytorch
git clone https://github.com/pytorch/xla.git
cd ..

# Run whatever is in `command` here
"${@:0}"
|||,
],

image: 'us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/xla',
imageTag: 'nightly_3.8_cuda_11.8',

podTemplate+:: {
spec+: {
Expand All @@ -128,6 +145,7 @@ local volumes = import 'templates/volumes.libsonnet';
containerMap+:: {
train+: {
envMap+: {
PJRT_DEVICE: 'GPU',
GPU_NUM_DEVICES: '%d' % config.accelerator.count,
},
},
Expand Down
15 changes: 0 additions & 15 deletions tests/pytorch/nightly/mnist.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,6 @@ local utils = import 'templates/utils.libsonnet';
v4_8:: {
accelerator: tpus.v4_8,
},
local gpu = self.gpu,
gpu:: common.GpuMixin {
// Disable XLA metrics report on GPU
command+: [
'--nometrics_debug',
],
flags+: {
modelDir: null,
},
},
local v100x4 = self.v100x4,
v100x4:: gpu {
accelerator: gpus.teslaV100 { count: 4 },
},

local tpuVm = self.tpuVm,
tpuVm:: common.PyTorchTpuVmMixin {
Expand Down Expand Up @@ -135,6 +121,5 @@ local utils = import 'templates/utils.libsonnet';
mnist + convergence + v2_8 + timeouts.Hours(1) + pjrt,
mnist + convergence_ddp + v2_8 + timeouts.Hours(1) + pjrt + pjrt_ddp,
mnist + convergence + v4_8 + timeouts.Hours(1) + pjrt + mixins.Experimental,
mnist + convergence + v100x4 + timeouts.Hours(6) + mixins.Experimental,
],
}
14 changes: 7 additions & 7 deletions tests/pytorch/nightly/resnet50-mp.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ local tpus = import 'templates/tpus.libsonnet';
flags:: {
modelDir: '$(MODEL_DIR)',
},
volumeMap+: {
datasets: common.datasetsVolume,
},

cpu: '90.0',
memory: '400Gi',
},

local fake_data = self.fake_data,
Expand All @@ -63,6 +57,9 @@ local tpus = import 'templates/tpus.libsonnet';
'--num_epochs=2',
'--datadir=/datasets/imagenet-mini',
],
volumeMap+: {
datasets: common.datasetsVolume,
},
},
local convergence = self.convergence,
convergence:: common.Convergence {
Expand Down Expand Up @@ -91,6 +88,9 @@ local tpus = import 'templates/tpus.libsonnet';
},
},
},
volumeMap+: {
datasets: common.datasetsVolume,
},
},
// DDP converges worse than MP.
local convergence_ddp = self.convergence_ddp,
Expand Down Expand Up @@ -201,7 +201,6 @@ local tpus = import 'templates/tpus.libsonnet';

configs: [
// XRT
resnet50 + functional + v100x4 + timeouts.Hours(1),
resnet50 + functional + v3_8 + timeouts.Hours(2) + tpuVm + mixins.Experimental,
resnet50 + fake_data + v3_8 + timeouts.Hours(2) + tpuVm,
resnet50 + fake_data + v3_8 + timeouts.Hours(2) + tpuVm + xrt_ddp,
Expand All @@ -214,6 +213,7 @@ local tpus = import 'templates/tpus.libsonnet';
resnet50 + convergence + v4_8 + timeouts.Hours(24) + tpuVm + mixins.Experimental,
resnet50 + convergence + v4_32 + timeouts.Hours(24) + tpuVm + mixins.Experimental,
// PJRT
resnet50 + fake_data + v100x4 + timeouts.Hours(1),
resnet50 + fake_data + v3_8 + timeouts.Hours(2) + pjrt,
resnet50 + convergence + v3_8 + timeouts.Hours(24) + pjrt,
resnet50 + fake_data + v3_8 + timeouts.Hours(2) + pjrt + pjrt_ddp,
Expand Down