config.yml 17.9 KB
Newer Older
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
1
2
3
4
5
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
# Adopted from
6
# https://github.com/facebookresearch/detectron2/blob/main/.circleci/config.yml
7
8
#
# Pro tip: download circle ci cli to validate the config locally during development.
9
10
11
12
13
14
15
16
#
# To reset/clean the cache update the CACHE_VERSION variable in project settings
# in the fairscale project in CircleCI. The CACHE_VERSION follows the convention
# v$(FAIRSCALE_VERSION)-${CACHE_NUMBER}. E.g. v0.4.2-1. CACHE_NUMBER must start
# at 1 and increase in whole numbers. When changing the CACHE_VERSION manually
# always set the FAIRSCALE_VERSION value to the fairscale version being tested.
# To reset the cache when not updating the fairscale version, only update the
# CACHE_NUMBER value.
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
17

Min Xu's avatar
Min Xu committed
18
version: 2.1
19
20
orbs:
  codecov: codecov/codecov@1.0.2
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
21
22
23
# -------------------------------------------------------------------------------------
# Environments to run the jobs in
# -------------------------------------------------------------------------------------
24
cpu_py37: &cpu_py37
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
25
  docker:
26
    # python version 3.7.12
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
27
    - image: circleci/python:3.7
28
  resource_class: large
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
29

30
31
cpu_py38: &cpu_py38
  docker:
32
    # python version 3.8.12
33
    - image: circleci/python:3.8
34
  resource_class: large
35
36
37

cpu_py39: &cpu_py39
  docker:
38
    # python version 3.9.7
39
    - image: circleci/python:3.9
40
  resource_class: large
41

42
# Here is the list of GPU images:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
43
# https://circleci.com/docs/2.0/configuration-reference/#available-linux-gpu-images
44
45
# We need to use multiple gpus for several jobs. The resource_class
# values are available here T101565170
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
46
47
48
49
# gpu.nvidia.small.multi = 2 gpus with 16 GB ram each
# gpu.nvidia.medium.multi = 4 gpus with 16 GB ram each

gpu_cu_11_2_small_multi: &gpu_cu_11_2_small_multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
50
  environment:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
51
52
    CUDA_VERSION: "11.2"
    CUDA_HOME: /usr/local/cuda-11.2
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
53
  machine:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
54
55
    image: ubuntu-2004-cuda-11.2:202103-01
  resource_class: gpu.nvidia.small.multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
56

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
57
gpu_cu_11_2_medium_multi: &gpu_cu_11_2_medium_multi
58
  environment:
59
60
    CUDA_VERSION: "11.2"
    CUDA_HOME: /usr/local/cuda-11.2
61
  machine:
62
    image: ubuntu-2004-cuda-11.2:202103-01
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
63
  resource_class: gpu.nvidia.medium.multi
64

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -------------------------------------------------------------------------------------
# Re-usable commands
# -------------------------------------------------------------------------------------
setup_venv: &setup_venv
  - run:
      name: Setup Virtual Env
      working_directory: ~/
      command: |
        python -m venv ~/venv
        echo ". ~/venv/bin/activate" >> $BASH_ENV
        . ~/venv/bin/activate
        python --version
        which python
        which pip
        pip install --upgrade pip

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
81
# most recent LTS version
82
install_dep_1_8_2: &install_dep_1_8_2
83
  - run:
84
      name: Install Dependencies with torch 1.8.2 (LTS)
85
      command: |
86
        # check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
Min Xu's avatar
Min Xu committed
87
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.8 && exit 0; fi
88
        # start installing
89
        pip install --progress-bar off torch==1.8.2+cu102 torchvision==0.9.2+cu102 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
90
        pip install --progress-bar off -r requirements-dev.txt
91
        pip install --progress-bar off -r requirements-benchmarks.txt
92
93
94
        python -c 'import torch; print("Torch version:", torch.__version__)'
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "8"], "wrong torch version"'
        python -m torch.utils.collect_env
Min Xu's avatar
Min Xu committed
95
        wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py
96

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
97
# most recent stable version
98
install_dep_1_10_2: &install_dep_1_10_2
99
  - run:
100
      name: Install Dependencies with torch 1.10.2
101
102
      command: |
        # check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
103
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.10 && exit 0; fi
104
        # start installing
105
        pip install --progress-bar off torch==1.10.2+cu113 torchvision==0.11.3+cu113 -f https://download.pytorch.org/whl/torch_stable.html
106
        pip install --progress-bar off -r requirements-dev.txt
107
108
        pip install --progress-bar off -r requirements-benchmarks.txt
        python -c 'import torch; print("Torch version:", torch.__version__)'
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
109
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "10"], "wrong torch version"'
110
111
112
        python -m torch.utils.collect_env
        wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py

113
114
115
116
117
install_dep_pytorch_nightly: &install_dep_pytorch_nightly
  - run:
      name: Install Dependencies with a torch nightly preview build
      command: |
        # check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
118
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.12 && exit 0; fi
119
        # start installing
Min Xu's avatar
Min Xu committed
120
        pip install --progress-bar off --pre torch==1.12.0.dev20220424+cu113 torchvision==0.13.0.dev20220424+cu113 -f https://download.pytorch.org/whl/nightly/cu113/torch_nightly.html
121
        pip install --progress-bar off -r requirements-dev.txt
122
123
        pip install --progress-bar off -r requirements-benchmarks.txt
        python -c 'import torch; print("Torch version:", torch.__version__)'
124
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "12"], "wrong torch version"'
125
126
127
        python -m torch.utils.collect_env
        wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py

128
install_repo: &install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
129
130
131
  - run:
      name: Install Repository
      command: |
132
133
134
        pip install .
        # Test import.
        python -c 'import sys; sys.path = sys.path[1:]; import fairscale'
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
135

136
137
138
139
140
141
check_test_list: &check_test_list
  - run:
      name: Verify that unit test list files are correct
      command: |
        bash ./tests/ci_test_list_check.sh

142
143
144
145
upload_coverage: &upload_coverage
  - codecov/upload:
      file: 'coverage.xml'
      token: $CODECOV_TOKEN
msbaines's avatar
msbaines committed
146

147
148
149
150
run_offload_benchmark: &run_offload_benchmark
  - run:
      name: Run Offload Benchmark
      command: |
151
        python benchmarks/experimental/offload.py --checkpoint_activation
152

153
154
155
156
157
158
run_fsdp_benchmark: &run_fsdp_benchmark
  - run:
      name: Run FSDP Benchmark
      command: |
        python benchmarks/fsdp.py --use_synthetic_data

Jun Ru Anderson's avatar
Jun Ru Anderson committed
159
run_pipe_benchmark: &run_pipe_benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
160
  - run:
Jun Ru Anderson's avatar
Jun Ru Anderson committed
161
      name: Run Pipe Benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
162
      command: |
Jun Ru Anderson's avatar
Jun Ru Anderson committed
163
        python benchmarks/pipe.py
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
164

165
166
167
168
run_oss_benchmark: &run_oss_benchmark
  - run:
      name: Run OSS Benchmark
      command: |
169
        python benchmarks/oss.py --world_size 4 --epochs 2
170
        python benchmarks/oss.py --check_regression --world_size 4 --optim_type oss_sharded_ddp --epochs 12
171
172

run_oss_gloo: &run_oss_gloo
173
174
175
176
177
178
  - run:
      name: Run OSS with Gloo
      command: |
        python benchmarks/oss.py --gloo --optim_type oss_ddp --epochs 2
        python benchmarks/oss.py --gloo --optim_type oss_sharded_ddp --epochs 2

179
run_oss_amp: &run_oss_amp
180
181
182
183
184
   - run:
       name: Run OSS with Torch AMP
       command: |
         python benchmarks/oss.py --amp --epochs 3 --optim_type oss_sharded_ddp

185
186
187
188
189
190
run_oss_for_each: &run_oss_for_each
   - run:
       name: Run OSS with Torch AMP and ForEach optmizer
       command: |
         python benchmarks/oss.py --amp --epochs 3 --optim_type oss_sharded_ddp --multi_tensor_optim

191
192
193
194
195
196
197
198
199
run_doc_build: &run_doc_build
   - run:
       name: Testing doc build
       command: |
         cd docs
         pip install --progress-bar off -r requirements.txt
         make help
         make singlehtml | tee make.out
         ! tail make.out | grep -q warning
200

201
202
203
204
205
206
# This is an alias to run all unit tests possible on a platform.
run_unittests: &run_unittests
   - run:
       name: Run all unit tests.
       # We run all and not stopping on failure on CPU since docker time is cheaper.
       command: |
207
         pytest --junitxml=test-results/junit.xml --verbose --timeout 60 --cov-report=xml --cov=./
208

Min Xu's avatar
Min Xu committed
209
commands:
210
211
212
213

   # This is a command (like a function) that run tests from a given test_list_file.
   # If test_list_file is not given, this results in an error.
   run_unittests_from_list:
Min Xu's avatar
Min Xu committed
214
     parameters:
215
       test_list_file:
Min Xu's avatar
Min Xu committed
216
         type: string
217
         default: "/dev/non_exist"  # Default to error out
Min Xu's avatar
Min Xu committed
218
219
220
221
     steps:
       - run:
           name: Run Unit Tests
           command: |
222
             if [ ! -f <<parameters.test_list_file>> ]; then exit 1; fi
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
223
             pytest --junitxml=test-results/junit.xml --verbose --timeout 70 --cov-report=xml --cov=./ `cat <<parameters.test_list_file>>`
Min Xu's avatar
Min Xu committed
224

225
226
227
228
229
230
231
232
   setup_pyenv:
     parameters:
       version:
         type: string
     steps:
       - run:
           name: Setup pyenv
           command: |
anj-s's avatar
anj-s committed
233
             git clone https://github.com/pyenv/pyenv-update.git $(pyenv root)/plugins/pyenv-update
234
235
236
237
             pyenv update
             pyenv install -f <<parameters.version>>
             pyenv global <<parameters.version>>

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
238
239
240
241
242
# -------------------------------------------------------------------------------------
# Jobs to run
# -------------------------------------------------------------------------------------

jobs:
243
244
  cpu_tests_py37:
    <<: *cpu_py37
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
245
246
247
248
249

    working_directory: ~/fairscale

    steps:
      - checkout
250
      - <<: *check_test_list
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
251
252
253
254
255
      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
256
            - cache-key-cpu-py37-torch-1-10-0-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
257

258
      - <<: *install_dep_1_10_2
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
259
260
261
262

      - save_cache:
          paths:
            - ~/venv
263
          key: cache-key-cpu-py37-torch-1-10-0-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
264

265
      - <<: *install_repo
266
      - <<: *run_unittests
267
268
269
270
      - <<: *run_doc_build

      - store_test_results:
          path: test-results
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
271

272
273
  cpu_tests_py38:
    <<: *cpu_py38
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
274

275
    working_directory: ~/fairscale
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
276

277
278
    steps:
      - checkout
279
      - <<: *check_test_list
280
      - <<: *setup_venv
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
281

282
283
284
      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
285
            - cache-key-cpu-py38-torch-1-10-0-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
286
      - <<: *install_dep_1_10_2
287
288
289
290

      - save_cache:
          paths:
            - ~/venv
291
          key: cache-key-cpu-py38-torch-1-10-0-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
292

293
      - <<: *install_repo
294
      - <<: *run_unittests
295
      - <<: *run_doc_build
296

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
297
298
299
      - store_test_results:
          path: test-results

300
301
302
303
304
305
306
  cpu_tests_py39:
    <<: *cpu_py39

    working_directory: ~/fairscale

    steps:
      - checkout
307
      - <<: *check_test_list
308
309
310
311
312
      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
313
            - cache-key-cpu-py39-torch-1-10-0-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
314

315
      - <<: *install_dep_1_10_2
316
317
318
319

      - save_cache:
          paths:
            - ~/venv
320
          key: cache-key-cpu-py39-torch-1-10-0-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
321

322
      - <<: *install_repo
323
      - <<: *run_unittests
324
325
326
327
328
      - <<: *run_doc_build

      - store_test_results:
          path: test-results

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
329
  gpu_tests_1_8_1:
Min Xu's avatar
Min Xu committed
330
    parameters:
331
      test_list_file:
Min Xu's avatar
Min Xu committed
332
        type: string
333
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
334

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
335
    <<: *gpu_cu_11_2_small_multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
336
337
338
339
340
341
342
343

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

344
      # Run this to make sure we use python3 from the system.
345
      - setup_pyenv:
346
          version: 3.9.7
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
347
348
349
350
351
352

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
353
            - cache-key-py-3-9-7-gpu-torch-1-8-1-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
354

355
      - <<: *install_dep_1_8_2
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
356
357
358
359

      - save_cache:
          paths:
            - ~/venv
360
          key: cache-key-py-3-9-7-gpu-torch-1-8-1-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
361

362
      - <<: *install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
363

364
365
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
366
367
368

      - store_test_results:
          path: test-results
369

370
      - <<: *upload_coverage
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
371

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
372
  gpu_tests_1_10_0:
Min Xu's avatar
Min Xu committed
373
    parameters:
374
      test_list_file:
Min Xu's avatar
Min Xu committed
375
        type: string
376
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
377

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
378
    <<: *gpu_cu_11_2_small_multi
379
380
381
382
383
384
385
386

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

387
      # Run this to make sure we use python3 from the system.
388
      - setup_pyenv:
389
          version: 3.9.7
390
391
392
393
394
395

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
396
            - cache-key-py-3-9-7-gpu-torch-1-10-0-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
397

398
      - <<: *install_dep_1_10_2
399
400
401
402

      - save_cache:
          paths:
            - ~/venv
403
          key: cache-key-py-3-9-7-gpu-torch-1-10-0-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
404

405
      - <<: *install_repo
406

407
408
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
409
410
411

      - store_test_results:
          path: test-results
412

413
  gpu_tests_pytorch_nightly:
414
415
416
417
418
    parameters:
      test_list_file:
        type: string
        default: "/dev/non_exist"

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
419
    <<: *gpu_cu_11_2_medium_multi
420
421
422
423
424
425
426
427
428

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

      # Run this to make sure we use python3 from the system.
429
      - setup_pyenv:
430
          version: 3.9.7
431
432
433
434
435
436

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
437
            - cache-key-py-3-9-7-gpu-pytorch-nightly-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
438

439
      - <<: *install_dep_pytorch_nightly
440
441
442
443

      - save_cache:
          paths:
            - ~/venv
444
          key: cache-key-py-3-9-7-gpu-pytorch-nightly-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
445
446
447
448
449
450
451
452
453

      - <<: *install_repo

      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>

      - store_test_results:
          path: test-results

454
  benchmarks_1:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
455
    <<: *gpu_cu_11_2_small_multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
456
457
458
459
460
461
462
463

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

464
      - setup_pyenv:
465
          version: 3.9.7
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
466
467
468
469
470
471

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
472
            - cache-key-py-3-9-7-benchmarks-torch-1-10-0-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
473

474
475
476
      # Cache the MNIST directory that contains benchmark data
      - restore_cache:
          keys:
477
            - cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION }}-{{checksum "benchmarks/datasets/mnist.py"}}
478

479
      - <<: *install_dep_1_10_2
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
480
481
482
483

      - save_cache:
          paths:
            - ~/venv
484
          key: cache-key-py-3-9-7-benchmarks-torch-1-10-0-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
485

486
      - <<: *install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
487

Jun Ru Anderson's avatar
Jun Ru Anderson committed
488
      - <<: *run_pipe_benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
489

490
491
      - <<: *run_offload_benchmark

492
493
494
      - <<: *run_oss_amp

      - <<: *run_oss_for_each
495

496
497
      - <<: *run_oss_gloo

498
499
      - <<: *run_fsdp_benchmark

500
501
502
      - save_cache:
          paths:
            - /tmp/MNIST
503
          key: cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION }}-{{checksum "benchmarks/datasets/mnist.py"}}
504

505
  benchmarks_2:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
506
    <<: *gpu_cu_11_2_medium_multi
507
508
509
510
511
512
513
514

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

515
      - setup_pyenv:
516
          version: 3.9.7
517
518
519
520
521
522

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
523
            - cache-key-py-3-9-7-benchmarks-torch-1-10-0-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
524

525
526
527
528

      # Cache the MNIST directory that contains benchmark data
      - restore_cache:
          keys:
529
            - cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION }}-{{checksum "benchmarks/datasets/mnist.py"}}
530

531
      - <<: *install_dep_1_10_2
532
533
534
535

      - save_cache:
          paths:
            - ~/venv
536
          key: cache-key-py-3-9-7-benchmarks-torch-1-10-0-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
537

538
      - <<: *install_repo
539
540

      - <<: *run_oss_benchmark
541

542
543
544
      - save_cache:
          paths:
            - /tmp/MNIST
545
          key: cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION}}-{{checksum "benchmarks/datasets/mnist.py"}}
546

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
547
548
549
550
551

workflows:
  version: 2
  build:
    jobs:
552
553
554
      - cpu_tests_py37
      - cpu_tests_py38
      - cpu_tests_py39
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
555
      - gpu_tests_1_8_1:
556
          test_list_file: tests/ci_test_list_1.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
557
      - gpu_tests_1_10_0:
558
          test_list_file: tests/ci_test_list_1.txt
559
560
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_1.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
561
      - gpu_tests_1_8_1:
562
          test_list_file: tests/ci_test_list_2.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
563
      - gpu_tests_1_10_0:
564
          test_list_file: tests/ci_test_list_2.txt
565
566
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_2.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
567
      - gpu_tests_1_8_1:
568
          test_list_file: tests/ci_test_list_3.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
569
      - gpu_tests_1_10_0:
570
          test_list_file: tests/ci_test_list_3.txt
571
572
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_3.txt
573
574
      - benchmarks_1
      - benchmarks_2