config.yml 17.8 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
82
# most recent LTS version
install_dep_1_8_1: &install_dep_1_8_1
83
  - run:
84
      name: Install Dependencies with torch 1.8.1 (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.1+cu102 torchvision==0.9.1+cu102 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
90
        pip install --progress-bar off -r requirements-test.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
98
# most recent stable version
install_dep_1_10_0: &install_dep_1_10_0
99
  - run:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
100
      name: Install Dependencies with torch 1.10.0
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
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
105
        pip install --progress-bar off torch==1.10.0+cu111 torchvision==0.11.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
106
107
108
        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
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
118
119
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
120
        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
121
122
123
        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__)'
124
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "11"], "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

Jun Ru Anderson's avatar
Jun Ru Anderson committed
153
run_pipe_benchmark: &run_pipe_benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
154
  - run:
Jun Ru Anderson's avatar
Jun Ru Anderson committed
155
      name: Run Pipe Benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
156
      command: |
Jun Ru Anderson's avatar
Jun Ru Anderson committed
157
        python benchmarks/pipe.py
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
158

159
160
161
162
run_oss_benchmark: &run_oss_benchmark
  - run:
      name: Run OSS Benchmark
      command: |
163
        python benchmarks/oss.py --world_size 4 --epochs 2
164
        python benchmarks/oss.py --check_regression --world_size 4 --optim_type oss_sharded_ddp
165
166

run_oss_gloo: &run_oss_gloo
167
168
169
170
171
172
  - 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

173
run_oss_amp: &run_oss_amp
174
175
176
177
178
   - run:
       name: Run OSS with Torch AMP
       command: |
         python benchmarks/oss.py --amp --epochs 3 --optim_type oss_sharded_ddp

179
180
181
182
183
184
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

185
186
187
188
189
190
191
192
193
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
194

195
196
197
198
199
200
# 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: |
201
         pytest --junitxml=test-results/junit.xml --verbose --timeout 60 --cov-report=xml --cov=./
202

Min Xu's avatar
Min Xu committed
203
commands:
204
205
206
207

   # 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
208
     parameters:
209
       test_list_file:
Min Xu's avatar
Min Xu committed
210
         type: string
211
         default: "/dev/non_exist"  # Default to error out
Min Xu's avatar
Min Xu committed
212
213
214
215
     steps:
       - run:
           name: Run Unit Tests
           command: |
216
             if [ ! -f <<parameters.test_list_file>> ]; then exit 1; fi
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
217
             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
218

219
220
221
222
223
224
225
226
   setup_pyenv:
     parameters:
       version:
         type: string
     steps:
       - run:
           name: Setup pyenv
           command: |
anj-s's avatar
anj-s committed
227
             git clone https://github.com/pyenv/pyenv-update.git $(pyenv root)/plugins/pyenv-update
228
229
230
231
             pyenv update
             pyenv install -f <<parameters.version>>
             pyenv global <<parameters.version>>

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
232
233
234
235
236
# -------------------------------------------------------------------------------------
# Jobs to run
# -------------------------------------------------------------------------------------

jobs:
237
238
  cpu_tests_py37:
    <<: *cpu_py37
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
239
240
241
242
243

    working_directory: ~/fairscale

    steps:
      - checkout
244
      - <<: *check_test_list
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
245
246
247
248
249
      - <<: *setup_venv

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

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
252
      - <<: *install_dep_1_10_0
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
253
254
255
256

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

259
      - <<: *install_repo
260
      - <<: *run_unittests
261
262
263
264
      - <<: *run_doc_build

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

266
267
  cpu_tests_py38:
    <<: *cpu_py38
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
268

269
    working_directory: ~/fairscale
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
270

271
272
    steps:
      - checkout
273
      - <<: *check_test_list
274
      - <<: *setup_venv
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
275

276
277
278
      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
279
            - cache-key-cpu-py38-torch-1-10-0-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-test.txt"}}
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
280
      - <<: *install_dep_1_10_0
281
282
283
284

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

287
      - <<: *install_repo
288
      - <<: *run_unittests
289
      - <<: *run_doc_build
290

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
291
292
293
      - store_test_results:
          path: test-results

294
295
296
297
298
299
300
  cpu_tests_py39:
    <<: *cpu_py39

    working_directory: ~/fairscale

    steps:
      - checkout
301
      - <<: *check_test_list
302
303
304
305
306
      - <<: *setup_venv

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

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
309
      - <<: *install_dep_1_10_0
310
311
312
313

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

316
      - <<: *install_repo
317
      - <<: *run_unittests
318
319
320
321
322
      - <<: *run_doc_build

      - store_test_results:
          path: test-results

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
323
  gpu_tests_1_8_1:
Min Xu's avatar
Min Xu committed
324
    parameters:
325
      test_list_file:
Min Xu's avatar
Min Xu committed
326
        type: string
327
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
328

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
329
    <<: *gpu_cu_11_2_small_multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
330
331
332
333
334
335
336
337

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

338
      # Run this to make sure we use python3 from the system.
339
      - setup_pyenv:
340
          version: 3.9.7
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
341
342
343
344
345
346

      - <<: *setup_venv

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

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
349
      - <<: *install_dep_1_8_1
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
350
351
352
353

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

356
      - <<: *install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
357

358
359
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
360
361
362

      - store_test_results:
          path: test-results
363

364
      - <<: *upload_coverage
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
365

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
366
  gpu_tests_1_10_0:
Min Xu's avatar
Min Xu committed
367
    parameters:
368
      test_list_file:
Min Xu's avatar
Min Xu committed
369
        type: string
370
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
371

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
372
    <<: *gpu_cu_11_2_small_multi
373
374
375
376
377
378
379
380

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

381
      # Run this to make sure we use python3 from the system.
382
      - setup_pyenv:
383
          version: 3.9.7
384
385
386
387
388
389

      - <<: *setup_venv

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

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
392
      - <<: *install_dep_1_10_0
393
394
395
396

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

399
      - <<: *install_repo
400

401
402
      - run_unittests_from_list:
          test_list_file: <<parameters.test_list_file>>
403
404
405

      - store_test_results:
          path: test-results
406

407
  gpu_tests_pytorch_nightly:
408
409
410
411
412
    parameters:
      test_list_file:
        type: string
        default: "/dev/non_exist"

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
413
    <<: *gpu_cu_11_2_medium_multi
414
415
416
417
418
419
420
421
422

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

      # Run this to make sure we use python3 from the system.
423
      - setup_pyenv:
424
          version: 3.9.7
425
426
427
428
429
430

      - <<: *setup_venv

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

433
      - <<: *install_dep_pytorch_nightly
434
435
436
437

      - save_cache:
          paths:
            - ~/venv
438
          key: cache-key-py-3-9-7-gpu-pytorch-nightly-cuda-11-2-{{.Environment.CACHE_VERSION }}-{{checksum "setup.py"}}-{{checksum "requirements-test.txt"}}
439
440
441
442
443
444
445
446
447

      - <<: *install_repo

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

      - store_test_results:
          path: test-results

448
  benchmarks_1:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
449
    <<: *gpu_cu_11_2_small_multi
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
450
451
452
453
454
455
456
457

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

458
      - setup_pyenv:
459
          version: 3.9.7
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
460
461
462
463
464
465

      - <<: *setup_venv

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

468
469
470
      # Cache the MNIST directory that contains benchmark data
      - restore_cache:
          keys:
471
            - cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION }}-{{checksum "benchmarks/datasets/mnist.py"}}
472

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
473
      - <<: *install_dep_1_10_0
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
474
475
476
477

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

480
      - <<: *install_repo
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
481

Jun Ru Anderson's avatar
Jun Ru Anderson committed
482
      - <<: *run_pipe_benchmark
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
483

484
485
      - <<: *run_offload_benchmark

486
487
488
      - <<: *run_oss_amp

      - <<: *run_oss_for_each
489

490
491
      - <<: *run_oss_gloo

492
493
494
      - save_cache:
          paths:
            - /tmp/MNIST
495
          key: cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION }}-{{checksum "benchmarks/datasets/mnist.py"}}
496

497
  benchmarks_2:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
498
    <<: *gpu_cu_11_2_medium_multi
499
500
501
502
503
504
505
506

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

507
      - setup_pyenv:
508
          version: 3.9.7
509
510
511
512
513
514

      - <<: *setup_venv

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

517
518
519
520

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

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
523
      - <<: *install_dep_1_10_0
524
525
526
527

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

530
      - <<: *install_repo
531
532

      - <<: *run_oss_benchmark
533

534
535
536
      - save_cache:
          paths:
            - /tmp/MNIST
537
          key: cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION}}-{{checksum "benchmarks/datasets/mnist.py"}}
538

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
539
540
541
542
543

workflows:
  version: 2
  build:
    jobs:
544
545
546
      - cpu_tests_py37
      - cpu_tests_py38
      - cpu_tests_py39
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
547
      - gpu_tests_1_8_1:
548
          test_list_file: tests/ci_test_list_1.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
549
      - gpu_tests_1_10_0:
550
          test_list_file: tests/ci_test_list_1.txt
551
552
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_1.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
553
      - gpu_tests_1_8_1:
554
          test_list_file: tests/ci_test_list_2.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
555
      - gpu_tests_1_10_0:
556
          test_list_file: tests/ci_test_list_2.txt
557
558
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_2.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
559
      - gpu_tests_1_8_1:
560
          test_list_file: tests/ci_test_list_3.txt
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
561
      - gpu_tests_1_10_0:
562
          test_list_file: tests/ci_test_list_3.txt
563
564
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_3.txt
565
566
      - benchmarks_1
      - benchmarks_2