config.yml 19.1 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
#
# To reset/clean the cache update the CACHE_VERSION variable in project settings
Min Xu's avatar
Min Xu committed
11
# in the fairscale project in CircleCI's web UI. The CACHE_VERSION follows the convention
12
13
14
15
16
# 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
25
26
cpu_py38: &cpu_py38
  docker:
    - image: circleci/python:3.8
27
  resource_class: large
28
29
30
31

cpu_py39: &cpu_py39
  docker:
    - image: circleci/python:3.9
32
  resource_class: large
33

Min Xu's avatar
Min Xu committed
34
35
36
37
38
cpu_py310: &cpu_py310
  docker:
    - image: circleci/python:3.10
  resource_class: large

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

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

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
62
63
64
65
66
67
68
# -------------------------------------------------------------------------------------
# Re-usable commands
# -------------------------------------------------------------------------------------
setup_venv: &setup_venv
  - run:
      name: Setup Virtual Env
      working_directory: ~/
69
70
      # use bash -x for debug early commands executed in .bashrc.
      shell: /bin/bash
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
71
      command: |
72
73
        set -e
        set -o pipefail
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
74
75
76
77
78
79
80
81
        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
82
# most recent LTS version
83
install_dep_pytorch_lts: &install_dep_pytorch_lts
84
  - run:
85
      name: Install Dependencies with torch 1.8.2 (LTS)
86
      command: |
87
        # check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
Min Xu's avatar
Min Xu committed
88
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.8 && exit 0; fi
89
        # start installing
90
        pip install --progress-bar off torch==1.8.2+cu111 torchvision==0.9.2+cu111 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu111
91
        pip install --progress-bar off -r requirements-dev.txt
92
        pip install --progress-bar off -r requirements-benchmarks.txt
93
        python -c 'import torch; print("Torch version:", torch.__version__)'
94
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "8"], f"wrong torch version {torch.__version__}"'
95
        python -m torch.utils.collect_env
Min Xu's avatar
Min Xu committed
96
        wget -O /home/circleci/venv/check_version.py https://raw.githubusercontent.com/min-xu-ai/check_verion/main/check_version.py
97

Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
98
# most recent stable version
99
install_dep_pytorch_stable: &install_dep_pytorch_stable
100
  - run:
101
      name: Install Dependencies with torch 1.12.0
102
103
      command: |
        # check if we have restored venv cache (/home/circleci/venv) correctly, if so, just skip
Min Xu's avatar
Min Xu committed
104
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.11 && exit 0; fi
105
        # start installing
106
        pip install --progress-bar off torch==1.12.0+cu113 torchvision==0.13.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
107
        pip install --progress-bar off -r requirements-dev.txt
108
109
        pip install --progress-bar off -r requirements-benchmarks.txt
        python -c 'import torch; print("Torch version:", torch.__version__)'
110
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "12"], f"wrong torch version {torch.__version__}"'
111
112
113
        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

114
115
116
117
118
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
119
        if [ -f /home/circleci/venv/check_version.py ]; then python /home/circleci/venv/check_version.py torch eq 1.12 && exit 0; fi
120
        # start installing
121
        pip install --pre torch==1.13.0.dev20220625+cu113 torchvision==0.14.0.dev20220625+cu113 --extra-index-url https://download.pytorch.org/whl/nightly/cu113
122
        pip install --progress-bar off -r requirements-dev.txt
123
124
        pip install --progress-bar off -r requirements-benchmarks.txt
        python -c 'import torch; print("Torch version:", torch.__version__)'
125
        python -c 'import torch; assert torch.__version__.split(".")[:2] == ["1", "13"], f"wrong torch version {torch.__version__}"'
126
127
128
        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

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

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

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

148
149
150
151
run_offload_benchmark: &run_offload_benchmark
  - run:
      name: Run Offload Benchmark
      command: |
Crutcher Dunnavant's avatar
Crutcher Dunnavant committed
152
        PYTHONPATH=. python benchmarks/experimental/offload.py --checkpoint_activation
153

154
155
156
157
run_fsdp_benchmark: &run_fsdp_benchmark
  - run:
      name: Run FSDP Benchmark
      command: |
Crutcher Dunnavant's avatar
Crutcher Dunnavant committed
158
        PYTHONPATH=. python benchmarks/fsdp.py --use_synthetic_data
159

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

166
167
168
169
run_oss_benchmark: &run_oss_benchmark
  - run:
      name: Run OSS Benchmark
      command: |
Crutcher Dunnavant's avatar
Crutcher Dunnavant committed
170
171
        PYTHONPATH=. python benchmarks/oss.py --world_size 4 --epochs 2
        PYTHONPATH=. python benchmarks/oss.py --check_regression --world_size 4 --optim_type oss_sharded_ddp --epochs 12
172
173

run_oss_gloo: &run_oss_gloo
174
175
176
  - run:
      name: Run OSS with Gloo
      command: |
Crutcher Dunnavant's avatar
Crutcher Dunnavant committed
177
178
        PYTHONPATH=. python benchmarks/oss.py --gloo --optim_type oss_ddp --epochs 2
        PYTHONPATH=. python benchmarks/oss.py --gloo --optim_type oss_sharded_ddp --epochs 2
179

180
run_oss_amp: &run_oss_amp
181
182
183
   - run:
       name: Run OSS with Torch AMP
       command: |
Crutcher Dunnavant's avatar
Crutcher Dunnavant committed
184
         PYTHONPATH=. python benchmarks/oss.py --amp --epochs 3 --optim_type oss_sharded_ddp
185

186
187
188
189
run_oss_for_each: &run_oss_for_each
   - run:
       name: Run OSS with Torch AMP and ForEach optmizer
       command: |
Crutcher Dunnavant's avatar
Crutcher Dunnavant committed
190
         PYTHONPATH=. python benchmarks/oss.py --amp --epochs 3 --optim_type oss_sharded_ddp --multi_tensor_optim
191

192
193
194
195
196
197
198
199
200
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
201

202
203
204
205
206
207
# 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: |
208
         ulimit -n 10000
209
         pytest --junitxml=test-results/junit.xml --verbose --timeout 60 --cov-report=xml --cov=./
210

Min Xu's avatar
Min Xu committed
211
commands:
212
213
214
215

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

228
229
230
231
232
   setup_pyenv:
     parameters:
       version:
         type: string
     steps:
233
234
235
236
237
       # Cache the pyenv download directory to avoid re-downloading over and over.
       - restore_cache:
          keys:
             - cache-key-pyenv-3-9-7-v1

238
239
       - run:
           name: Setup pyenv
240
241
242
243
244
           # We used to use the following commands to update pyenv.
           #   git clone https://github.com/pyenv/pyenv-update.git $(pyenv root)/plugins/pyenv-update
           #   pyenv update
           # However, it is not deterministic since pyenv is being updated.
           # It is now fixed to a version. (v2.3.0 is broken since it cause bash to fail when it try to do "eval $(pyenv init -)")
245
246
247
248
           #
           # We use "-sf" to skip already installed version after cache restoring the pyenv dir. This should avoid redoing
           # downloading and installing. The key name has a "v1" in the end so that we can debug and try different cache objects
           # while doing development.
249
           command: |
250
251
252
             cd /opt/circleci/.pyenv/
             git remote update
             git checkout v2.2.0
253
             pyenv install -sf <<parameters.version>>
254
255
             pyenv global <<parameters.version>>

256
257
258
259
260
       - save_cache:
          paths:
             - /opt/circleci/.pyenv
          key: cache-key-pyenv-3-9-7-v1

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
261
262
263
264
265
# -------------------------------------------------------------------------------------
# Jobs to run
# -------------------------------------------------------------------------------------

jobs:
Min Xu's avatar
Min Xu committed
266
267
  cpu_tests_py38:
    <<: *cpu_py38
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
268
269
270
271
272

    working_directory: ~/fairscale

    steps:
      - checkout
273
      - <<: *check_test_list
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
274
275
276
277
278
      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Min Xu's avatar
Min Xu committed
279
            - cache-key-cpu-py38-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
280
      - <<: *install_dep_pytorch_stable
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
281
282
283
284

      - save_cache:
          paths:
            - ~/venv
Min Xu's avatar
Min Xu committed
285
          key: cache-key-cpu-py38-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
286

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

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

Min Xu's avatar
Min Xu committed
294
295
  cpu_tests_py39:
    <<: *cpu_py39
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
296

297
    working_directory: ~/fairscale
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
298

299
300
    steps:
      - checkout
301
      - <<: *check_test_list
302
      - <<: *setup_venv
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
303

304
305
306
      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Min Xu's avatar
Min Xu committed
307
308
            - cache-key-cpu-py39-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}

309
      - <<: *install_dep_pytorch_stable
310
311
312
313

      - save_cache:
          paths:
            - ~/venv
Min Xu's avatar
Min Xu committed
314
          key: cache-key-cpu-py39-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
315

316
      - <<: *install_repo
317
      - <<: *run_unittests
318
      - <<: *run_doc_build
319

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
320
321
322
      - store_test_results:
          path: test-results

Min Xu's avatar
Min Xu committed
323
324
  cpu_tests_py310:
    <<: *cpu_py310
325
326
327
328
329

    working_directory: ~/fairscale

    steps:
      - checkout
330
      - <<: *check_test_list
331
332
333
334
335
      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Min Xu's avatar
Min Xu committed
336
            - cache-key-cpu-py310-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
337

338
      - <<: *install_dep_pytorch_stable
339
340
341
342

      - save_cache:
          paths:
            - ~/venv
Min Xu's avatar
Min Xu committed
343
          key: cache-key-cpu-py310-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
344

345
      - <<: *install_repo
346
      - <<: *run_unittests
347
348
349
350
351
      - <<: *run_doc_build

      - store_test_results:
          path: test-results

Min Xu's avatar
Min Xu committed
352
  gpu_tests_lts:
Min Xu's avatar
Min Xu committed
353
    parameters:
354
      test_list_file:
Min Xu's avatar
Min Xu committed
355
        type: string
356
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
357

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

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

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

      - <<: *setup_venv

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

378
      - <<: *install_dep_pytorch_lts
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
379
380
381
382

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

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

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

      - store_test_results:
          path: test-results
392

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

Min Xu's avatar
Min Xu committed
395
  gpu_tests_stable:
Min Xu's avatar
Min Xu committed
396
    parameters:
397
      test_list_file:
Min Xu's avatar
Min Xu committed
398
        type: string
399
        default: "/dev/non_exist"
Min Xu's avatar
Min Xu committed
400

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

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

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

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Min Xu's avatar
Min Xu committed
419
            - cache-key-py-3-9-7-gpu-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
420

421
      - <<: *install_dep_pytorch_stable
422
423
424
425

      - save_cache:
          paths:
            - ~/venv
Min Xu's avatar
Min Xu committed
426
          key: cache-key-py-3-9-7-gpu-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
427

428
      - <<: *install_repo
429

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

      - store_test_results:
          path: test-results
435

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

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

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

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

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Min Xu's avatar
Min Xu committed
460
            - cache-key-py-3-9-7-gpu-torch-1-12-0424-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
461

462
      - <<: *install_dep_pytorch_nightly
463
464
465
466

      - save_cache:
          paths:
            - ~/venv
Min Xu's avatar
Min Xu committed
467
          key: cache-key-py-3-9-7-gpu-torch-1-12-0424-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
468
469
470
471
472
473
474
475
476

      - <<: *install_repo

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

      - store_test_results:
          path: test-results

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

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

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

      - <<: *setup_venv

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

497
498
499
      # Cache the MNIST directory that contains benchmark data
      - restore_cache:
          keys:
Min Xu's avatar
Min Xu committed
500
            - cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION}}-{{checksum "benchmarks/datasets/mnist.py"}}
501

502
      - <<: *install_dep_pytorch_stable
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
503
504
505
506

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

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

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

513
514
      - <<: *run_offload_benchmark

515
516
517
      - <<: *run_oss_amp

      - <<: *run_oss_for_each
518

519
520
      - <<: *run_oss_gloo

521
522
      - <<: *run_fsdp_benchmark

523
524
525
      - save_cache:
          paths:
            - /tmp/MNIST
Min Xu's avatar
Min Xu committed
526
          key: cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION}}-{{checksum "benchmarks/datasets/mnist.py"}}
527

528
  benchmarks_2:
Anupam Bhatnagar's avatar
Anupam Bhatnagar committed
529
    <<: *gpu_cu_11_2_medium_multi
530
531
532
533
534
535
536
537

    working_directory: ~/fairscale

    steps:
      - checkout

      - run: nvidia-smi

538
      - setup_pyenv:
539
          version: 3.9.7
540
541
542
543
544
545

      - <<: *setup_venv

      # Cache the venv directory that contains dependencies
      - restore_cache:
          keys:
Min Xu's avatar
Min Xu committed
546
            - cache-key-py-3-9-7-benchmarks-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
547

548
549
550
551

      # Cache the MNIST directory that contains benchmark data
      - restore_cache:
          keys:
Min Xu's avatar
Min Xu committed
552
            - cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION}}-{{checksum "benchmarks/datasets/mnist.py"}}
553

554
      - <<: *install_dep_pytorch_stable
555
556
557
558

      - save_cache:
          paths:
            - ~/venv
Min Xu's avatar
Min Xu committed
559
          key: cache-key-py-3-9-7-benchmarks-torch-1-11-0-{{.Environment.CACHE_VERSION}}-{{checksum "setup.py"}}-{{checksum "requirements-dev.txt"}}
560

561
      - <<: *install_repo
562
563

      - <<: *run_oss_benchmark
564

565
566
567
      - save_cache:
          paths:
            - /tmp/MNIST
568
          key: cache-key-benchmark-MNIST-{{.Environment.CACHE_VERSION}}-{{checksum "benchmarks/datasets/mnist.py"}}
569

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
570
571
572
573
574

workflows:
  version: 2
  build:
    jobs:
575
576
      - cpu_tests_py38
      - cpu_tests_py39
Min Xu's avatar
Min Xu committed
577
578
      - cpu_tests_py310
      - gpu_tests_lts:
579
          test_list_file: tests/ci_test_list_1.txt
Min Xu's avatar
Min Xu committed
580
      - gpu_tests_stable:
581
          test_list_file: tests/ci_test_list_1.txt
582
583
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_1.txt
Min Xu's avatar
Min Xu committed
584
      - gpu_tests_lts:
585
          test_list_file: tests/ci_test_list_2.txt
Min Xu's avatar
Min Xu committed
586
      - gpu_tests_stable:
587
          test_list_file: tests/ci_test_list_2.txt
588
589
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_2.txt
Min Xu's avatar
Min Xu committed
590
      - gpu_tests_lts:
591
          test_list_file: tests/ci_test_list_3.txt
Min Xu's avatar
Min Xu committed
592
      - gpu_tests_stable:
593
          test_list_file: tests/ci_test_list_3.txt
594
595
      - gpu_tests_pytorch_nightly:
          test_list_file: tests/ci_test_list_3.txt
596
597
      - benchmarks_1
      - benchmarks_2