From 45e350c3b69cd2743cecb2ec78cd92149304ba0f Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 14:08:39 +0800 Subject: [PATCH 1/9] [worfklow] added coverage test --- .github/workflows/build.yml | 10 +++++++++- .gitignore | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5366f69cc7b0..89ea88e72e24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,7 @@ jobs: - name: Unit Testing run: | - PYTHONPATH=$PWD pytest tests + PYTHONPATH=$PWD pytest --cov=. --cov-report lcov tests env: DATA: /data/scratch/cifar-10 NCCL_SHM_DISABLE: 1 @@ -85,3 +85,11 @@ jobs: run: | # -p flag is required to preserve the file timestamp to avoid ninja rebuild cp -p -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/ + + - name: Report code coverage + uses: zgosalvez/github-actions-report-lcov@v1 + with: + coverage-files: coverage.lcov + minimum-coverage: 90 + artifact-name: code-coverage-report + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 6b6f980e3392..8e345eeb8388 100644 --- a/.gitignore +++ b/.gitignore @@ -151,3 +151,6 @@ colossalai/version.py # ignore python interface defition file .pyi + +# ignore coverage test file +converage.lcov From 58ee49ddb28fc870dfe27f02016517160c57774e Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 14:35:02 +0800 Subject: [PATCH 2/9] polish code --- requirements/requirements-test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/requirements-test.txt b/requirements/requirements-test.txt index f9e8960d2eaf..9ef0a682b6b8 100644 --- a/requirements/requirements-test.txt +++ b/requirements/requirements-test.txt @@ -1,5 +1,6 @@ fbgemm-gpu==0.2.0 pytest +pytest-cov torchvision transformers timm From 6535f137fd1a55c239b0843c4350306483f1596e Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 15:38:00 +0800 Subject: [PATCH 3/9] polish code --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89ea88e72e24..3008f0b344f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,8 @@ jobs: - name: Unit Testing run: | - PYTHONPATH=$PWD pytest --cov=. --cov-report lcov tests + PYTHONPATH=$PWD pytest --cov=. --cov-report lcov tests/test_amp + ls -la env: DATA: /data/scratch/cifar-10 NCCL_SHM_DISABLE: 1 From df450c848031b2de65be47722988131c2efda335 Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 15:46:23 +0800 Subject: [PATCH 4/9] polish code --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3008f0b344f5..ce5710baadec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,7 @@ jobs: - name: Report code coverage uses: zgosalvez/github-actions-report-lcov@v1 with: - coverage-files: coverage.lcov + coverage-files: $PWD/coverage.lcov minimum-coverage: 90 artifact-name: code-coverage-report github-token: ${{ secrets.GITHUB_TOKEN }} From 99feea3177f63403ac707cee68b28dccaadc449b Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 15:51:44 +0800 Subject: [PATCH 5/9] polish code --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce5710baadec..43577038f973 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,10 +87,13 @@ jobs: # -p flag is required to preserve the file timestamp to avoid ninja rebuild cp -p -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/ + - name: Setup LCOV + uses: hrishikesh-kadam/setup-lcov@v1 + - name: Report code coverage uses: zgosalvez/github-actions-report-lcov@v1 with: - coverage-files: $PWD/coverage.lcov + coverage-files: coverage.lcov minimum-coverage: 90 artifact-name: code-coverage-report github-token: ${{ secrets.GITHUB_TOKEN }} From e9a978512d86197fa4e519b0d6a934711bff44f7 Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 15:53:54 +0800 Subject: [PATCH 6/9] polish code --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43577038f973..5291803df26f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,7 +88,7 @@ jobs: cp -p -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/ - name: Setup LCOV - uses: hrishikesh-kadam/setup-lcov@v1 + uses: hrishikesh-kadam/setup-lcov@v1 # set up lcov for reporting - name: Report code coverage uses: zgosalvez/github-actions-report-lcov@v1 From ea761c13b6df75b5eb13bc12dffe729bed8a8a32 Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 16:35:20 +0800 Subject: [PATCH 7/9] polish code --- .github/workflows/build.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5291803df26f..edd2fb65dacf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,14 +86,3 @@ jobs: run: | # -p flag is required to preserve the file timestamp to avoid ninja rebuild cp -p -r /__w/ColossalAI/ColossalAI/build /github/home/cuda_ext_cache/ - - - name: Setup LCOV - uses: hrishikesh-kadam/setup-lcov@v1 # set up lcov for reporting - - - name: Report code coverage - uses: zgosalvez/github-actions-report-lcov@v1 - with: - coverage-files: coverage.lcov - minimum-coverage: 90 - artifact-name: code-coverage-report - github-token: ${{ secrets.GITHUB_TOKEN }} From dcb8e2d39f4f1566cd605539cf34ed8080fab11f Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 16:40:14 +0800 Subject: [PATCH 8/9] polish code --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index edd2fb65dacf..af635ffcbb0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,7 @@ jobs: - name: Unit Testing run: | - PYTHONPATH=$PWD pytest --cov=. --cov-report lcov tests/test_amp + PYTHONPATH=$PWD pytest --cov=. --cov-report lcov tests ls -la env: DATA: /data/scratch/cifar-10 From f447ec815f3f576e342bc876169aff0debdfe804 Mon Sep 17 00:00:00 2001 From: FrankLeeeee Date: Mon, 9 Jan 2023 17:17:30 +0800 Subject: [PATCH 9/9] polish code --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af635ffcbb0c..62d6350d6511 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} - name: Find the changed files id: find-changed-files uses: tj-actions/changed-files@v35 @@ -76,7 +77,6 @@ jobs: - name: Unit Testing run: | PYTHONPATH=$PWD pytest --cov=. --cov-report lcov tests - ls -la env: DATA: /data/scratch/cifar-10 NCCL_SHM_DISABLE: 1