config.yml 17.3 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.
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
9

Min Xu's avatar
Min Xu committed
10
version: 2.1
11
12
orbs:
  codecov: codecov/codecov@1.0.2
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
13
14
15
# -------------------------------------------------------------------------------------
# Environments to run the jobs in
# -------------------------------------------------------------------------------------
16
cpu_py37: &cpu_py37
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
17
18
  docker:
    - image: circleci/python:3.7
19
  resource_class: large
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
20

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

cpu_py39: &cpu_py39
  docker:
    - image: circleci/python:3.9
29
  resource_class: large
30

31
# Here are list of GPU images:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
32
33
34
35
36
37
38
# https://circleci.com/docs/2.0/configuration-reference/#available-linux-gpu-images
# We need to use multiple gpus for several jobs. the resource_class values are
# available here T101565170
# 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
39
  environment:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
40
41
    CUDA_VERSION: "11.2"
    CUDA_HOME: /usr/local/cuda-11.2
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
42
  machine:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
43
44
    image: ubuntu-2004-cuda-11.2:202103-01
  resource_class: gpu.nvidia.small.multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
45

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
46
gpu_cu_11_2_medium_multi: &gpu_cu_11_2_medium_multi
47
  environment:
48
49
    CUDA_VERSION: "11.2"
    CUDA_HOME: /usr/local/cuda-11.2
50
  machine:
51
    image: ubuntu-2004-cuda-11.2:202103-01
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
52
  resource_class: gpu.nvidia.medium.multi
53

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -------------------------------------------------------------------------------------
# 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
70
71
# most recent LTS version
install_dep_1_8_1: &install_dep_1_8_1
72
  - run:
73
      name: Install Dependencies with torch 1.8.1 (LTS)
74
      command: |
75
        # check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
Min Xu's avatar
Min Xu committed
76
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.8 && exit 0; fi
77
        # start installing
78
        pip install --progress-bar off torch==1.8.1+cu102 torchvision==0.9.1+cu102 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
79
        pip install --progress-bar off -r requirements-test.txt
80
        pip install --progress-bar off -r requirements-benchmarks.txt
81
82
83
        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
84
        wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py
85

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
86
87
# most recent stable version
install_dep_1_10_0: &install_dep_1_10_0
88
  - run:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
89
      name: Install Dependencies with torch 1.10.0
90
91
      command: |
        # check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
92
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.10 && exit 0; fi
93
        # start installing
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
94
        pip install --progress-bar off torch==1.10.0+cu111 torchvision==0.11.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
95
96
97
        pip install --progress-bar off -r requirements-test.txt
        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
98
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "10"], "wrong torch version"'
99
100
101
        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

102
103
104
105
106
107
108
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
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.10 && exit 0; fi
        # start installing
109
        pip install --progress-bar off --pre torch==1.11.0.dev20211101+cu111 torchvision==0.12.0.dev20211101+cu111 -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html
110
111
112
        pip install --progress-bar off -r requirements-test.txt
        pip install --progress-bar off -r requirements-benchmarks.txt
        python -c 'import torch; print("Torch version:", torch.__version__)'
113
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "11"], "wrong torch version"'
114
115
116
        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

117
install_repo: &install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
118
119
120
  - run:
      name: Install Repository
      command: |
121
122
123
        pip install .
        # Test import.
        python -c 'import sys; sys.path = sys.path[1:]; import fairscale'
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
124

125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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

149
150
151
152
153
154
check_test_list: &check_test_list
  - run:
      name: Verify that unit test list files are correct
      command: |
        bash ./tests/ci_test_list_check.sh

155
156
157
158
upload_coverage: &upload_coverage
  - codecov/upload:
      file: 'coverage.xml'
      token: $CODECOV_TOKEN
msbaines's avatar
msbaines committed
159

160
161
162
163
run_offload_benchmark: &run_offload_benchmark
  - run:
      name: Run Offload Benchmark
      command: |
164
        python benchmarks/experimental/offload.py --checkpoint_activation
165

Jun Ru Anderson's avatar
Jun Ru Anderson committed
166
run_pipe_benchmark: &run_pipe_benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
167
  - run:
Jun Ru Anderson's avatar
Jun Ru Anderson committed
168
      name: Run Pipe Benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
169
      command: |
Jun Ru Anderson's avatar
Jun Ru Anderson committed
170
        python benchmarks/pipe.py
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
171

172
173
174
175
run_oss_benchmark: &run_oss_benchmark
  - run:
      name: Run OSS Benchmark
      command: |
176
        python benchmarks/oss.py --world_size 4 --epochs 2
177
        python benchmarks/oss.py --check_regression --world_size 4 --optim_type oss_sharded_ddp
178
179

run_oss_gloo: &run_oss_gloo
180
181
182
183
184
185
  - 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

186
run_oss_amp: &run_oss_amp
187
188
189
190
191
   - run:
       name: Run OSS with Torch AMP
       command: |
         python benchmarks/oss.py --amp --epochs 3 --optim_type oss_sharded_ddp

192
193
194
195
196
197
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

198
199
200
201
202
203
204
205
206
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
207

208
209
210
211
212
213
# 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: |
214
         pytest --junitxml=test-results/junit.xml --verbose --timeout 60 --cov-report=xml --cov=./
215

Min Xu's avatar
Min Xu committed
216
commands:
217
218
219
220

   # 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
221
     parameters:
222
       test_list_file:
Min Xu's avatar
Min Xu committed
223
         type: string
224
         default: "/dev/non_exist"  # Default to error out
Min Xu's avatar
Min Xu committed
225
226
227
228
     steps:
       - run:
           name: Run Unit Tests
           command: |
229
             if [ ! -f <<parameters.test_list_file>> ]; then exit 1; fi
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
230
             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
231

232
233
234
235
236
237
238
239
   setup_pyenv:
     parameters:
       version:
         type: string
     steps:
       - run:
           name: Setup pyenv
           command: |
anj-s's avatar
anj-s committed
240
             git clone https://github.com/pyenv/pyenv-update.git $(pyenv root)/plugins/pyenv-update
241
242
243
244
             pyenv update
             pyenv install -f <<parameters.version>>
             pyenv global <<parameters.version>>

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
245
246
247
248
249
# -------------------------------------------------------------------------------------
# Jobs to run
# -------------------------------------------------------------------------------------

jobs:
250
251
  cpu_tests_py37:
    <<: *cpu_py37
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
252
253
254
255
256

    working_directory: ~/fairscale

    steps:
      - checkout
257
      - <<: *check_test_list
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
258
259
260
261
262
      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
263
            - cache-key-cpu-py37-torch-1-10-0-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
264

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
265
      - <<: *install_dep_1_10_0
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
266
267
268
269

      - save_cache:
          paths:
            - ~/venv
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
270
          key: cache-key-cpu-py37-torch-1-10-0-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
271

272
      - <<: *install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
273

274
275
276
277
      - <<: *run_isort
      - <<: *run_black
      - <<: *run_mypy
      - <<: *run_flake8
278
      - <<: *run_unittests
279
280
281
282
      - <<: *run_doc_build

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

284
285
  cpu_tests_py38:
    <<: *cpu_py38
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
286

287
    working_directory: ~/fairscale
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
288

289
290
    steps:
      - checkout
291
      - <<: *check_test_list
292
      - <<: *setup_venv
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
293

294
295
296
      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
297
298
            - cache-key-cpu-py38-torch-1-10-0-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
      - <<: *install_dep_1_10_0
299
300
301
302

      - save_cache:
          paths:
            - ~/venv
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
303
          key: cache-key-cpu-py38-torch-1-10-0-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
304

305
      - <<: *install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
306

307
308
309
310
      - <<: *run_isort
      - <<: *run_black
      - <<: *run_mypy
      - <<: *run_flake8
311
      - <<: *run_unittests
312
      - <<: *run_doc_build
313

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
314
315
316
      - store_test_results:
          path: test-results

317
318
319
320
321
322
323
  cpu_tests_py39:
    <<: *cpu_py39

    working_directory: ~/fairscale

    steps:
      - checkout
324
      - <<: *check_test_list
325
326
327
328
329
      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
330
            - cache-key-cpu-py39-torch-1-10-0-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
331

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
332
      - <<: *install_dep_1_10_0
333
334
335
336

      - save_cache:
          paths:
            - ~/venv
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
337
          key: cache-key-cpu-py39-torch-1-10-0-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
338

339
      - <<: *install_repo
340
341
342
343
344

      - <<: *run_isort
      - <<: *run_black
      - <<: *run_mypy
      - <<: *run_flake8
345
      - <<: *run_unittests
346
347
348
349
350
      - <<: *run_doc_build

      - store_test_results:
          path: test-results

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
351
  gpu_tests_1_8_1:
Min Xu's avatar
Min Xu committed
352
    parameters:
353
      test_list_file:
Min Xu's avatar
Min Xu committed
354
        type: string
355
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
356

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
357
    <<: *gpu_cu_11_2_small_multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
358
359
360
361
362
363
364
365

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

366
      # Run this to make sure we use python3 from the system.
367
      - setup_pyenv:
368
          version: 3.7.0
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
369
370
371
372
373
374

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
375
            - cache-key-py37-gpu-torch-1-8-1-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
376

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
377
      - <<: *install_dep_1_8_1
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
378
379
380
381

      - save_cache:
          paths:
            - ~/venv
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
382
          key: cache-key-py37-gpu-torch-1-8-1-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
383

384
      - <<: *install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
385

386
387
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
388
389
390

      - store_test_results:
          path: test-results
391

392
      - <<: *upload_coverage
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
393

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
394
  gpu_tests_1_10_0:
Min Xu's avatar
Min Xu committed
395
    parameters:
396
      test_list_file:
Min Xu's avatar
Min Xu committed
397
        type: string
398
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
399

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
400
    <<: *gpu_cu_11_2_small_multi
401
402
403
404
405
406
407
408

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

409
      # Run this to make sure we use python3 from the system.
410
      - setup_pyenv:
411
          version: 3.8.6
412
413
414
415
416
417

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
418
            - cache-key-py38-gpu-torch-1-10-0-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
419

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
420
      - <<: *install_dep_1_10_0
421
422
423
424

      - save_cache:
          paths:
            - ~/venv
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
425
          key: cache-key-py38-gpu-torch-1-10-0-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
426

427
      - <<: *install_repo
428

429
430
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
431
432
433

      - store_test_results:
          path: test-results
434

435
  gpu_tests_pytorch_nightly:
436
437
438
439
440
    parameters:
      test_list_file:
        type: string
        default: "/dev/non_exist"

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
441
    <<: *gpu_cu_11_2_medium_multi
442
443
444
445
446
447
448
449
450

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

      # Run this to make sure we use python3 from the system.
451
      - setup_pyenv:
452
          version: 3.8.6
453
454
455
456
457
458

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
459
            - cache-key-py38-gpu-pytorch-nightly-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
460

461
      - <<: *install_dep_pytorch_nightly
462
463
464
465

      - save_cache:
          paths:
            - ~/venv
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
466
          key: cache-key-py38-gpu-pytorch-nightly-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
467
468
469
470
471
472
473
474
475

      - <<: *install_repo

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

      - store_test_results:
          path: test-results

476
  benchmarks_1:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
477
    <<: *gpu_cu_11_2_small_multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
478
479
480
481
482
483
484
485

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

486
487
      - setup_pyenv:
          version: 3.7.0
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
488
489
490
491
492
493

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
494
            - cache-key-py37-benchmarks-torch-1-10-0-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
495

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

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
501
      - <<: *install_dep_1_10_0
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
502
503
504
505

      - save_cache:
          paths:
            - ~/venv
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
506
          key: cache-key-py37-benchmarks-torch-1-10-0-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
507

508
      - <<: *install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
509

Jun Ru Anderson's avatar
Jun Ru Anderson committed
510
      - <<: *run_pipe_benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
511

512
513
      - <<: *run_offload_benchmark

514
515
516
      - <<: *run_oss_amp

      - <<: *run_oss_for_each
517

518
519
      - <<: *run_oss_gloo

520
521
522
523
524
      - save_cache:
          paths:
            - /tmp/MNIST
          key: cache-key-benchmark-MNIST-{{ checksum "benchmarks/datasets/mnist.py"}}

525
  benchmarks_2:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
526
    <<: *gpu_cu_11_2_medium_multi
527
528
529
530
531
532
533
534

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

535
536
      - setup_pyenv:
          version: 3.7.0
537
538
539
540
541
542

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
543
            - cache-key-py37-benchmarks-torch-1-10-0-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
544

545
546
547
548
549
550

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

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
551
      - <<: *install_dep_1_10_0
552
553
554
555

      - save_cache:
          paths:
            - ~/venv
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
556
          key: cache-key-py37-benchmarks-torch-1-10-0-cuda-11-2-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
557

558
      - <<: *install_repo
559
560

      - <<: *run_oss_benchmark
561

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

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
567
568
569
570
571

workflows:
  version: 2
  build:
    jobs:
572
573
574
      - cpu_tests_py37
      - cpu_tests_py38
      - cpu_tests_py39
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
575
      - gpu_tests_1_8_1:
576
          test_list_file: tests/ci_test_list_1.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
577
      - gpu_tests_1_10_0:
578
          test_list_file: tests/ci_test_list_1.txt
579
580
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_1.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
581
      - gpu_tests_1_8_1:
582
          test_list_file: tests/ci_test_list_2.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
583
      - gpu_tests_1_10_0:
584
          test_list_file: tests/ci_test_list_2.txt
585
586
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_2.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
587
      - gpu_tests_1_8_1:
588
          test_list_file: tests/ci_test_list_3.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
589
      - gpu_tests_1_10_0:
590
          test_list_file: tests/ci_test_list_3.txt
591
592
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_3.txt
593
594
      - benchmarks_1
      - benchmarks_2