config.yml 18.5 KB
Newer Older
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
1
2
3
4
5
6
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
# Adopted from
# https://github.com/facebookresearch/detectron2/blob/master/.circleci/config.yml
7
8
#
# Pro tip: download circle ci cli to validate the config locally during development.
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
9

Min Xu's avatar
Min Xu committed
10
version: 2.1
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
11
12
13
14

# -------------------------------------------------------------------------------------
# Environments to run the jobs in
# -------------------------------------------------------------------------------------
15
cpu_py37: &cpu_py37
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
16
17
18
19
  docker:
    - image: circleci/python:3.7
  resource_class: medium

20
21
22
23
24
25
26
27
28
29
cpu_py38: &cpu_py38
  docker:
    - image: circleci/python:3.8
  resource_class: medium

cpu_py39: &cpu_py39
  docker:
    - image: circleci/python:3.9
  resource_class: medium

30
31
# Here are list of GPU images:
#   https://circleci.com/docs/2.0/configuration-reference/#available-linux-gpu-images
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
32
33
34
35
36
37
38
gpu: &gpu
  environment:
    CUDA_VERSION: "10.1"
  machine:
    image: ubuntu-1604-cuda-10.1:201909-23
  resource_class: gpu.large

39
40
41
42
43
44
45
gpu_cu111: &gpu_cu111
  environment:
    CUDA_VERSION: "11.1"
  machine:
    image: ubuntu-1604-cuda-11.1:202012-01
  resource_class: gpu.large

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -------------------------------------------------------------------------------------
# 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

62
install_dep_151: &install_dep_151
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
63
  - run:
64
      name: Install Dependencies with torch 1.5.1
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
65
      command: |
66
        sudo apt-get install -y libopenmpi-dev
67
        pip install --progress-bar off torch==1.5.1+cu101 torchvision==0.6.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
68
        pip install --progress-bar off -r requirements-test.txt
69
        pip install --progress-bar off -r requirements-benchmarks.txt
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
70
        python -c 'import torch; print("Torch version:", torch.__version__)'
71
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "5"], "wrong torch version"'
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
72
73
        python -m torch.utils.collect_env

74
install_dep_160: &install_dep_160
75
  - run:
76
      name: Install Dependencies with torch 1.6.0
77
      command: |
78
        sudo apt-get install -y libopenmpi-dev
79
        pip install --progress-bar off torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
80
        pip install --progress-bar off -r requirements-test.txt
81
        pip install --progress-bar off -r requirements-benchmarks.txt
82
        pip install --progress-bar off git+https://github.com/msbaines/torch_pg.git@c85c96f#egg=torch-pg
83
        python -c 'import torch; print("Torch version:", torch.__version__)'
84
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "6"], "wrong torch version"'
85
86
        python -m torch.utils.collect_env

87
install_dep_171: &install_dep_171
88
  - run:
89
      name: Install Dependencies with torch 1.7.1
90
91
      command: |
        sudo apt-get install -y libopenmpi-dev
92
        pip install --progress-bar off torch==1.7.1+cu101 torchvision==0.8.2+cu101 -f https://download.pytorch.org/whl/torch_stable.html
93
        pip install --progress-bar off -r requirements-test.txt
94
        pip install --progress-bar off -r requirements-benchmarks.txt
95
96
        pip install --progress-bar off git+https://github.com/msbaines/torch_pg.git@c85c96f#egg=torch-pg
        python -c 'import torch; print("Torch version:", torch.__version__)'
97
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "7"], "wrong torch version"'
98
99
        python -m torch.utils.collect_env

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
install_dep_171_cu110: &install_dep_171_cu110
  - run:
      name: Install Dependencies with torch 1.7.1+cu110
      command: |
        sudo add-apt-repository universe
        sudo apt-get update
        sudo apt-get install -y libopenmpi-dev
        pip install --progress-bar off torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html
        pip install --progress-bar off -r requirements-test.txt
        pip install --progress-bar off -r requirements-benchmarks.txt
        pip install --progress-bar off git+https://github.com/msbaines/torch_pg.git@c85c96f#egg=torch-pg
        python -c 'import torch; print("Torch version:", torch.__version__)'
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "7"], "wrong torch version"'
        python -m torch.utils.collect_env

115
116
117
118
119
120
install_dep_180: &install_dep_180
  - run:
      name: Install Dependencies with torch 1.8.0 nightly
      command: |
        sudo apt-get install -y libopenmpi-dev
        pip install --progress-bar off -r requirements-test.txt
121
122
        # Since we are using nightly builds, we bypass the benchmarks req file
        # and install ourselves for testing.
123
        #pip install --progress-bar off -r requirements-benchmarks.txt
124
125
126
127
128
129
130
131
        # torchvision nightly wants torch 1.9.
        pip install --pre --progress-bar off torchtext==0.6.0 \
          torchvision==0.9.0.dev20210222+cu112 \
          -f https://download.pytorch.org/whl/nightly/cu112/torch_nightly.html
        # we only use it a bit in benchmarking, so it might be safe to use 1.8.
        pip install --pre --progress-bar off torch==1.8.0.dev20210210+cu112 \
          -f https://download.pytorch.org/whl/nightly/cu112/torch_nightly.html
        pip install --progress-bar off  git+https://github.com/min-xu-ai/torch_pg.git@c723ab4#egg=torch-pg
132
133
        python -c 'import torch; print("Torch version:", torch.__version__)'
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "8"], "wrong torch version"'
134
        pip list|grep torch
135
136
        python -m torch.utils.collect_env

Jun Ru Anderson's avatar
Jun Ru Anderson committed
137
install_repo_cpu: &install_repo_cpu
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
138
139
140
  - run:
      name: Install Repository
      command: |
141
142
143
        pip install .
        # Test import.
        python -c 'import sys; sys.path = sys.path[1:]; import fairscale'
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
144

Jun Ru Anderson's avatar
Jun Ru Anderson committed
145
146
147
148
149
install_repo_gpu: &install_repo_gpu
  - run:
      name: Install Repository
      command: |
        export CUDA_HOME=/usr/local/cuda-10.1
150
        pip install -e .
msbaines's avatar
msbaines committed
151

152
153
154
155
156
157
158
install_repo_gpu_cu111: &install_repo_gpu_cu111
  - run:
      name: Install Repository
      command: |
        export CUDA_HOME=/usr/local/cuda-11.1
        pip install -e .

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183

run_isort: &run_isort
   - run:
       name: Run Linter (isort)
       command: |
         isort . --check

run_black: &run_black
   - run:
       name: Run Linter (black)
       command: |
         black --check .

run_mypy: &run_mypy
   - run:
       name: Run type-checking (mypy)
       command: |
         mypy --ignore-missing-imports --scripts-are-modules --pretty .

run_flake8: &run_flake8
  - run:
      name: Run Linter (flake8)
      command: |
        flake8 --show-source --statistics

184
185
186
187
188
189
check_test_list: &check_test_list
  - run:
      name: Verify that unit test list files are correct
      command: |
        bash ./tests/ci_test_list_check.sh

190

Min Xu's avatar
Min Xu committed
191
192
193
194
# TODO (Min): figure out how to do coverage nightly or on-demand. Doing it
# on every commit seems like an overkill since we can easily figure out which
# code is not covered without looking at coverage results from each commit.
# Also, it is a long pole for testing time, which slows down development a lot.
msbaines's avatar
msbaines committed
195
196
197
198
run_coverage: &run_coverage
  - run:
      name: Run Unit Tests With Coverage
      command: |
199
        pytest --junitxml=test-results/junit.xml --verbose --timeout 60 --cov-report=xml --cov=./
msbaines's avatar
msbaines committed
200
201
202
        #Uploading test coverage for Python code
        bash <(curl -s https://codecov.io/bash) -f coverage.xml -cF Python

203
204
205
206
run_mpi_unittests: &run_mpi_unittests
  - run:
      name: Run MPI Unit Tests
      command: |
207
        mpirun -n 4 python -m pytest -p torch_pg.pytest --only-mpi --junitxml=test-results/junit.xml --verbose tests/nn/moe
208

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
209

Jun Ru Anderson's avatar
Jun Ru Anderson committed
210
run_pipe_benchmark: &run_pipe_benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
211
  - run:
Jun Ru Anderson's avatar
Jun Ru Anderson committed
212
      name: Run Pipe Benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
213
      command: |
Jun Ru Anderson's avatar
Jun Ru Anderson committed
214
        python benchmarks/pipe.py
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
215

216
217
218
219
run_mp_pipe_benchmark: &run_mp_pipe_benchmark
  - run:
      name: Run Multiprocess Pipe Benchmark
      command: |
220
        python benchmarks/pipe.py --multiprocess --lazy-construction
221

222
223
224
225
run_oss_benchmark: &run_oss_benchmark
  - run:
      name: Run OSS Benchmark
      command: |
226
        python benchmarks/oss.py --world_size 4 --epochs 2
227
        python benchmarks/oss.py --check_regression --world_size 4 --optim_type oss_sharded_ddp
228
229

run_oss_gloo: &run_oss_gloo
230
231
232
233
234
235
  - 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

236
run_oss_amp: &run_oss_amp
237
238
239
240
241
   - run:
       name: Run OSS with Torch AMP
       command: |
         python benchmarks/oss.py --amp --epochs 3 --optim_type oss_sharded_ddp

242
243
244
245
246
247
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

248
249
250
251
252
253
254
255
256
257

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
258

259
260
261
262
263
264
265
266
# 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: |
         pytest --junitxml=test-results/junit.xml --verbose --timeout 60

Min Xu's avatar
Min Xu committed
267
commands:
268
269
270
271

   # 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
272
     parameters:
273
       test_list_file:
Min Xu's avatar
Min Xu committed
274
         type: string
275
         default: "/dev/non_exist"  # Default to error out
Min Xu's avatar
Min Xu committed
276
277
278
     steps:
       - run:
           name: Run Unit Tests
279
           # we use pytest -x so that it stops on first failure to save GPU time, which is expensive.
Min Xu's avatar
Min Xu committed
280
           command: |
281
282
             if [ ! -f <<parameters.test_list_file>> ]; then exit 1; fi
             pytest -x --junitxml=test-results/junit.xml --verbose --timeout 60 `cat <<parameters.test_list_file>>`
Min Xu's avatar
Min Xu committed
283

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
284
285
286
287
288
# -------------------------------------------------------------------------------------
# Jobs to run
# -------------------------------------------------------------------------------------

jobs:
289
290
  cpu_tests_py37:
    <<: *cpu_py37
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
291
292
293
294
295

    working_directory: ~/fairscale

    steps:
      - checkout
296
      - <<: *check_test_list
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
297
298
299
300
301
      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
302
            - cache-key-cpu-py37-171-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
303

304
      - <<: *install_dep_171
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
305
306
307
308

      - save_cache:
          paths:
            - ~/venv
309
          key: cache-key-cpu-py37-171-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
310

Jun Ru Anderson's avatar
Jun Ru Anderson committed
311
      - <<: *install_repo_cpu
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
312

313
314
315
316
      - <<: *run_isort
      - <<: *run_black
      - <<: *run_mypy
      - <<: *run_flake8
317
      - <<: *run_unittests
318
319
320
321
322
      - <<: *run_mpi_unittests
      - <<: *run_doc_build

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

324
325
  cpu_tests_py38:
    <<: *cpu_py38
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
326

327
    working_directory: ~/fairscale
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
328

329
330
    steps:
      - checkout
331
      - <<: *check_test_list
332
      - <<: *setup_venv
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
333

334
335
336
337
338
339
340
341
342
343
344
345
      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
            - cache-key-cpu-py38-171-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
      - <<: *install_dep_171

      - save_cache:
          paths:
            - ~/venv
          key: cache-key-cpu-py38-171-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}

      - <<: *install_repo_cpu
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
346

347
348
349
350
      - <<: *run_isort
      - <<: *run_black
      - <<: *run_mypy
      - <<: *run_flake8
351
      - <<: *run_unittests
352
      - <<: *run_mpi_unittests
353
      - <<: *run_doc_build
354

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
355
356
357
      - store_test_results:
          path: test-results

358
359
360
361
362
363
364
  cpu_tests_py39:
    <<: *cpu_py39

    working_directory: ~/fairscale

    steps:
      - checkout
365
      - <<: *check_test_list
366
367
368
369
370
      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
371
            - cache-key-cpu-py39-180-3-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
372

373
374
375
376
377
      # py3.9 doesn't work well with torch < 1.8. See this PR:
      # https://github.com/pytorch/pytorch/pull/50998
      #
      # Therefore, we test py39 with torch 1.8.0.
      - <<: *install_dep_180
378
379
380
381

      - save_cache:
          paths:
            - ~/venv
382
          key: cache-key-cpu-py39-180-3-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
383
384
385
386
387
388
389

      - <<: *install_repo_cpu

      - <<: *run_isort
      - <<: *run_black
      - <<: *run_mypy
      - <<: *run_flake8
390
      - <<: *run_unittests
391
      - <<: *run_mpi_unittests
392
393
394
395
396
397
      - <<: *run_doc_build

      - store_test_results:
          path: test-results


398
  gpu_tests_151:
Min Xu's avatar
Min Xu committed
399
    parameters:
400
      test_list_file:
Min Xu's avatar
Min Xu committed
401
        type: string
402
        default: "/dev/non_exist"
403

404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
    <<: *gpu

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

      - run: pyenv global 3.7.0

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
420
            - cache-key-gpu-151-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
421

422
      - <<: *install_dep_151
423
424
425
426

      - save_cache:
          paths:
            - ~/venv
427
          key: cache-key-gpu-151-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
428
429
430

      - <<: *install_repo_gpu

431
432
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
433
434
435
436

      - store_test_results:
          path: test-results

437
  gpu_tests_160:
Min Xu's avatar
Min Xu committed
438
    parameters:
439
      test_list_file:
Min Xu's avatar
Min Xu committed
440
        type: string
441
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
442

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
    <<: *gpu

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

      - run: pyenv global 3.7.0

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
459
            - cache-key-gpu-160-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
460

461
      - <<: *install_dep_160
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
462
463
464
465

      - save_cache:
          paths:
            - ~/venv
466
          key: cache-key-gpu-160-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
467

Jun Ru Anderson's avatar
Jun Ru Anderson committed
468
      - <<: *install_repo_gpu
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
469

470
471
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
472
473
474
475

      - store_test_results:
          path: test-results

476
  gpu_tests_171:
Min Xu's avatar
Min Xu committed
477
    parameters:
478
      test_list_file:
Min Xu's avatar
Min Xu committed
479
        type: string
480
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
481

482
    <<: *gpu_cu111
483
484
485
486
487
488
489
490

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

491
492
      # Run this to make sure we use python3 from the system.
      - run: pyenv global 3.8.6
493
494
495
496
497
498

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
499
            - cache-key-gpu-cu111-171-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
500

501
      - <<: *install_dep_171_cu110
502
503
504
505

      - save_cache:
          paths:
            - ~/venv
506
          key: cache-key-gpu-cu111-171-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
507

508
      - <<: *install_repo_gpu_cu111
509

510
511
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
512
513
514
515

      - store_test_results:
          path: test-results

516
  benchmarks_1:
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
517
518
519
520
521
522
523
524
525
    <<: *gpu

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

526
527
528
529
      - run: pyenv uninstall -f 3.7.0

      - run: pyenv install 3.7.0

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
530
531
532
533
534
535
536
      - run: pyenv global 3.7.0

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
537
            - cache-key-benchmarks-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
538

539
540
541
542
543
      # Cache the MNIST directory that contains benchmark data
      - restore_cache:
          keys:
            - cache-key-benchmark-MNIST-{{ checksum "benchmarks/datasets/mnist.py"}}

544
      - <<: *install_dep_171
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
545
546
547
548

      - save_cache:
          paths:
            - ~/venv
549
          key: cache-key-benchmarks-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
550

Jun Ru Anderson's avatar
Jun Ru Anderson committed
551
      - <<: *install_repo_gpu
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
552

Jun Ru Anderson's avatar
Jun Ru Anderson committed
553
      - <<: *run_pipe_benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
554

555
556
      - <<: *run_mp_pipe_benchmark

557
558
559
      - <<: *run_oss_amp

      - <<: *run_oss_for_each
560

561
562
      - <<: *run_oss_gloo

563
564
565
566
567
      - save_cache:
          paths:
            - /tmp/MNIST
          key: cache-key-benchmark-MNIST-{{ checksum "benchmarks/datasets/mnist.py"}}

568

569

570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
  benchmarks_2:
    <<: *gpu

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

      - run: pyenv uninstall -f 3.7.0

      - run: pyenv install 3.7.0

      - run: pyenv global 3.7.0

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
            - cache-key-benchmarks-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}

593
594
595
596
597
598

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

599
600
601
602
603
604
605
606
607
608
      - <<: *install_dep_171

      - save_cache:
          paths:
            - ~/venv
          key: cache-key-benchmarks-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}

      - <<: *install_repo_gpu

      - <<: *run_oss_benchmark
609

610
611
612
613
614
      - save_cache:
          paths:
            - /tmp/MNIST
          key: cache-key-benchmark-MNIST-{{ checksum "benchmarks/datasets/mnist.py"}}

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
615
616
617
618
619

workflows:
  version: 2
  build:
    jobs:
620
621
622
      - cpu_tests_py37
      - cpu_tests_py38
      - cpu_tests_py39
Min Xu's avatar
Min Xu committed
623
      - gpu_tests_151:
624
          test_list_file: tests/ci_test_list_1.txt
Min Xu's avatar
Min Xu committed
625
      - gpu_tests_160:
626
          test_list_file: tests/ci_test_list_1.txt
Min Xu's avatar
Min Xu committed
627
      - gpu_tests_171:
628
          test_list_file: tests/ci_test_list_1.txt
Min Xu's avatar
Min Xu committed
629
      - gpu_tests_151:
630
          test_list_file: tests/ci_test_list_2.txt
Min Xu's avatar
Min Xu committed
631
      - gpu_tests_160:
632
          test_list_file: tests/ci_test_list_2.txt
Min Xu's avatar
Min Xu committed
633
      - gpu_tests_171:
634
          test_list_file: tests/ci_test_list_2.txt
Min Xu's avatar
Min Xu committed
635
      - gpu_tests_151:
636
          test_list_file: tests/ci_test_list_3.txt
Min Xu's avatar
Min Xu committed
637
      - gpu_tests_160:
638
          test_list_file: tests/ci_test_list_3.txt
Min Xu's avatar
Min Xu committed
639
      - gpu_tests_171:
640
641
642
          test_list_file: tests/ci_test_list_3.txt
      - benchmarks_1
      - benchmarks_2