Skip to content

Commit 0786688

Browse files
Merge remote-tracking branch 'upstream/develop' into add_gather_double_grad
2 parents 51b3aa2 + cda38a4 commit 0786688

File tree

197 files changed

+3970
-1166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+3970
-1166
lines changed

.github/workflows/CI-Build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
name: Clone-linux
2121
uses: ./.github/workflows/_Clone-linux.yml
2222
with:
23-
bos_dir: Paddle-build
23+
clone_dir: Paddle-build
2424

2525
build-docker:
2626
name: build docker images
2727
needs: clone
2828
uses: ./.github/workflows/docker.yml
2929
with:
30-
bos_dir: Paddle-build
30+
clone_dir: Paddle-build
3131
task: build
3232

3333
build:

.github/workflows/Coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ jobs:
3434
uses: ./.github/workflows/_Clone-linux.yml
3535
with:
3636
workflow-name: 'coverage'
37-
bos_dir: Paddle-coverage
37+
clone_dir: Paddle-coverage
3838

3939
build-docker:
4040
name: Coverage build docker
4141
needs: clone
4242
uses: ./.github/workflows/docker.yml
4343
with:
44-
bos_dir: Paddle-coverage
44+
clone_dir: Paddle-coverage
4545
task: coverage
4646

4747
build:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Slice-baseline
2+
3+
on:
4+
schedule:
5+
- cron: '30 2 * * *'
6+
7+
permissions: read-all
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
jobs:
14+
clone:
15+
name: Slice-base clone
16+
uses: ./.github/workflows/_Clone-linux.yml
17+
with:
18+
clone_dir: Paddle-build
19+
is_pr: 'false'
20+
21+
build-docker:
22+
name: Slice build docker
23+
needs: clone
24+
uses: ./.github/workflows/docker.yml
25+
with:
26+
clone_dir: Paddle-build
27+
task: build
28+
29+
build:
30+
name: Slice build
31+
needs: [clone, build-docker]
32+
uses: ./.github/workflows/_Linux-build.yml
33+
with:
34+
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
35+
CI_name: slice-baseline
36+
is_pr: 'false'
37+
38+
slice-test:
39+
name: Slice test
40+
uses: ./.github/workflows/_Slice.yml
41+
needs: [clone, build-docker, build]
42+
with:
43+
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
44+
slice-check: 'true'
45+
SLICE_TEST_MODE: insert_baseline

.github/workflows/_Clone-linux.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ on:
66
workflow-name:
77
type: string
88
required: false
9-
bos_dir:
9+
clone_dir:
1010
type: string
1111
required: false
1212
default: 'Paddle'
13+
is_pr:
14+
type: string
15+
required: false
16+
default: 'true'
1317
outputs:
1418
can-skip:
1519
value: ${{ jobs.clone.outputs.can-skip }}
@@ -23,19 +27,18 @@ defaults:
2327
shell: bash
2428

2529
env:
26-
PR_ID: ${{ github.event.pull_request.number }}
27-
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
30+
PR_ID: ${{ github.event.pull_request.number || '0' }}
31+
COMMIT_ID: ${{ github.event.pull_request.head.sha || github.sha }}
2832
ci_scripts: ${{ github.workspace }}/ci
33+
BRANCH: ${{ github.event.pull_request.base.ref || github.ref_name }}
2934

3035
jobs:
3136
clone:
32-
# Don't run on forked repos.
3337
name: Clone Paddle
38+
if: ${{ github.repository_owner == 'PaddlePaddle' }}
3439
outputs:
3540
can-skip: ${{ steps.check-bypass.outputs.can-skip }}
3641
slice-check: ${{ steps.check-execution.outputs.slice-check }}
37-
38-
if: github.repository_owner == 'PaddlePaddle'
3942
runs-on:
4043
group: HK-Clone
4144

@@ -49,6 +52,7 @@ jobs:
4952

5053
- name: Merge PR to test branch
5154
id: check-execution
55+
if: ${{ inputs.is_pr == 'true' }}
5256
run: |
5357
git config --unset http.https://github.com/.extraheader
5458
git submodule foreach --recursive sh -c "git config --local --unset-all 'http.https://github.com/.extraheader'"
@@ -96,10 +100,10 @@ jobs:
96100
echo "::group::Install bce-python-sdk"
97101
python -m pip install bce-python-sdk==0.8.74
98102
echo "::endgroup::"
99-
python ${bos_file} Paddle.tar.gz paddle-github-action/PR/${{ inputs.bos_dir }}/${PR_ID}/${COMMIT_ID}
103+
python ${bos_file} Paddle.tar.gz paddle-github-action/PR/${{ inputs.clone_dir }}/${PR_ID}/${COMMIT_ID}
100104
rm Paddle.tar.gz
101105
cd -
102-
git switch ${{ github.event.pull_request.base.ref }}
106+
git switch ${BRANCH}
103107
git branch -D test
104108
git gc
105109

.github/workflows/_Doc-Preview.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Model-benchmark
1+
name: Doc-Preview
22

33
on:
44
workflow_call:
@@ -17,6 +17,8 @@ env:
1717
BRANCH: ${{ github.event.pull_request.base.ref }}
1818
TASK: paddle-CI-${{ github.event.pull_request.number }}-Doc-Preview
1919
CI_name: Doc-Preview
20+
CFS_DIR: /home/data/cfs
21+
work_dir: /paddle
2022
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
2123

2224
defaults:
@@ -34,11 +36,15 @@ jobs:
3436

3537
build-doc:
3638
name: Build doc
39+
needs: check-bypass
40+
if: ${{ inputs.can-skip != 'true' && needs.check-bypass.outputs.can-skip != 'true' }}
3741
runs-on:
3842
group: BD_BJ-V100
3943
steps:
40-
- name: Check docker image and run container
44+
- name: Check docker image and run container
4145
env:
46+
CACHE_DIR: /home/data/cfs/.cache
47+
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4248
AGILE_PULL_ID: ${{ github.event.pull_request.number }}
4349
AGILE_REVISION: ${{ github.event.pull_request.head.sha }}
4450
BUILD_DOC: "true"
@@ -48,6 +54,7 @@ jobs:
4854
AGILE_COMPILE_BRANCH: ${{ github.event.pull_request.base.ref }}
4955
BOS_CREDENTIAL_AK: "paddle"
5056
BOS_CREDENTIAL_SK: "paddle"
57+
PADDLE_WHL: https://paddle-github-action.cdn.bcebos.com/PR/build/${{ github.event.pull_request.number }}/${{ github.event.pull_request.head.sha }}/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
5158
run: |
5259
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
5360
echo "container_name=${container_name}" >> ${{ github.env }}
@@ -59,6 +66,8 @@ jobs:
5966
-v "/dev/shm:/dev/shm" \
6067
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
6168
-v ${{ github.workspace }}:/paddle \
69+
-e CACHE_DIR \
70+
-e GITHUB_API_TOKEN \
6271
-e AGILE_PULL_ID \
6372
-e AGILE_REVISION \
6473
-e BUILD_DOC \
@@ -69,16 +78,21 @@ jobs:
6978
-e AGILE_COMPILE_BRANCH \
7079
-e BOS_CREDENTIAL_AK \
7180
-e BOS_CREDENTIAL_SK \
81+
-e PADDLE_WHL \
82+
-e CFS_DIR \
83+
-e work_dir \
7284
-e no_proxy \
7385
-w /paddle --network host ${docker_image}
7486
7587
- name: Doc build
7688
run: |
7789
docker exec -t ${{ env.container_name }} /bin/bash -c '
7890
rm -rf * .[^.]*
79-
wget -q https://xly-devops.bj.bcebos.com/PR/build_whl/${AGILE_PULL_ID}/${AGILE_REVISION}/build.tar.gz
80-
tar --use-compress-program="pigz -1" -xpf build.tar.gz
81-
cd ./paddle
91+
echo "Downloading build.tar.gz from cfs"
92+
cp ${CFS_DIR}/build_bos/${AGILE_PULL_ID}/${AGILE_REVISION}/build.tar.gz .
93+
echo "Extracting build.tar.gz"
94+
git config --global --add safe.directory ${work_dir}
95+
tar --use-compress-program="pzstd -1" -xpf build.tar.gz --strip-components=1
8296
api_doc_spec_diff=$(python tools/diff_api.py paddle/fluid/API_DEV.spec.doc paddle/fluid/API_PR.spec.doc)
8397
if [ "$api_doc_spec_diff" == "" ]; then
8498
echo "API documents no change."
@@ -94,5 +108,6 @@ jobs:
94108
- name: Terminate and delete the container
95109
if: always()
96110
run: |
111+
set +e
97112
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
98113
docker rm -f ${{ env.container_name }}

.github/workflows/_Linux-build.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,28 @@ on:
66
docker_build_image:
77
type: string
88
required: true
9+
CI_name:
10+
type: string
11+
required: false
12+
default: 'build'
13+
is_pr:
14+
type: string
15+
required: false
16+
default: 'true'
917
outputs:
1018
can-skip:
1119
description: "Whether to skip the job"
1220
value: ${{ jobs.build.outputs.can-skip }}
1321

1422
env:
15-
PR_ID: ${{ github.event.pull_request.number }}
16-
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
23+
PR_ID: ${{ github.event.pull_request.number || '0' }}
24+
COMMIT_ID: ${{ github.event.pull_request.head.sha || github.sha }}
1725
work_dir: /paddle
1826
PADDLE_ROOT: /paddle
1927
TASK: paddle-CI-${{ github.event.pull_request.number }}-build
2028
ci_scripts: /paddle/ci
21-
BRANCH: ${{ github.event.pull_request.base.ref }}
22-
CI_name: build
29+
BRANCH: ${{ github.event.pull_request.base.ref || github.ref_name }}
30+
CI_name: ${{ inputs.CI_name }}
2331
CFS_DIR: /home/data/cfs
2432
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
2533

@@ -116,7 +124,7 @@ jobs:
116124
-e CI_name \
117125
-w /paddle --network host ${docker_image}
118126
119-
- name: Download paddle.tar.gz and merge target branch
127+
- name: Download paddle.tar.gz
120128
env:
121129
work_dir: ${{ github.workspace }}
122130
run: |
@@ -136,6 +144,14 @@ jobs:
136144
set +e
137145
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
138146
set -e
147+
'
148+
149+
- name: Merge target branch
150+
if: ${{ inputs.is_pr == 'true' }}
151+
env:
152+
work_dir: ${{ github.workspace }}
153+
run: |
154+
docker exec -t ${{ env.container_name }} /bin/bash -c '
139155
source ${{ github.workspace }}/../../../proxy
140156
cp ci/git_pull.sh ci/git_pull_copy.sh
141157
git checkout $BRANCH
@@ -147,6 +163,7 @@ jobs:
147163
148164
- name: Check bypass
149165
id: check-bypass
166+
if: ${{ inputs.is_pr == 'true' }}
150167
uses: ./.github/actions/check-bypass
151168
with:
152169
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/_Slice.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ on:
1212
slice-check:
1313
type: string
1414
required: false
15+
SLICE_TEST_MODE:
16+
type: string
17+
required: false
18+
default: 'test_ci'
1519

1620
env:
17-
PR_ID: ${{ github.event.pull_request.number }}
18-
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
21+
PR_ID: ${{ github.event.pull_request.number || '0' }}
22+
COMMIT_ID: ${{ github.event.pull_request.head.sha || github.sha }}
1923
work_dir: /paddle
2024
PADDLE_ROOT: /paddle
2125
TASK: paddle-CI-${{ github.event.pull_request.number }}-slice
2226
ci_scripts: /paddle/ci
23-
BRANCH: ${{ github.event.pull_request.base.ref }}
27+
BRANCH: ${{ github.event.pull_request.base.ref || github.ref_name }}
2428
CI_name: slice
2529
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
2630

@@ -35,16 +39,11 @@ jobs:
3539
runs-on:
3640
group: slice
3741
steps:
38-
# - name: Download test script
39-
# run: |
40-
# sudo rm -rf * .[^.]*
41-
# source ${{ github.workspace }}/../../../proxy
42-
# wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/refs/heads/develop/ci/slice/test_slice_float32.py
43-
4442
- name: Check docker image and run container
4543
env:
46-
wheel_link: https://paddle-github-action.bj.bcebos.com/PR/build/${{ github.event.pull_request.number }}/${{ github.event.pull_request.head.sha }}/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
44+
wheel_link: https://paddle-github-action.bj.bcebos.com/PR/build/${{ env.PR_ID }}/${{ env.COMMIT_ID }}/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
4745
RUN_ID: ${{ github.run_id }}
46+
SLICE_TEST_MODE: ${{ inputs.SLICE_TEST_MODE }}
4847
run: |
4948
container_name="api_benchmark_ci_${RUN_ID}"
5049
echo "container_name=${container_name}" >> ${{ github.env }}
@@ -64,41 +63,42 @@ jobs:
6463
-e ci_scripts \
6564
-e no_proxy \
6665
-e CI_name \
66+
-e SLICE_TEST_MODE \
6767
-w /paddle --network host ${docker_image}
6868
69-
- name: Download Paddle
69+
- name: Download PaddleTest
7070
env:
7171
work_dir: ${{ github.workspace }}
7272
run: |
7373
docker exec -t ${{ env.container_name }} /bin/bash -c '
7474
rm -rf * .[^.]*
75-
echo "Downloading build.tar.gz"
76-
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/build/${PR_ID}/${COMMIT_ID}/build.tar.gz --no-check-certificate
77-
echo "Extracting build.tar.gz"
75+
echo "Downloading PaddleTest"
76+
wget -q https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz --no-proxy
77+
echo "Extracting PaddleTest"
7878
git config --global --add safe.directory ${work_dir}
79-
tar --use-compress-program="pzstd -1" -xpf build.tar.gz --strip-components=1
79+
tar -xzf PaddleTest.tar.gz && cd PaddleTest
8080
git submodule foreach "git config --global --add safe.directory \$toplevel/\$sm_path"
81-
git checkout test
82-
rm build.tar.gz
8381
'
8482
8583
- name: Test
8684
env:
8785
work_dir: ${{ github.workspace }}
8886
run: |
8987
docker exec -t ${{ env.container_name }} /bin/bash -c '
90-
set -x
9188
mkdir -p ${{ github.workspace }}/../../../.cache/pip
9289
source ${{ github.workspace }}/../../../proxy
9390
python3.10 -m pip config set global.cache-dir ${{ github.workspace }}/../../../.cache/pip
9491
python3.10 -m pip install $wheel_link
95-
python3.10 -m pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu118
96-
export FLAGS_share_tensor_for_grad_tensor_holder=True
97-
python3.10 ci/slice/test_slice_perform.py
92+
python3.10 -m pip install -r PaddleTest/framework/e2e/api_benchmark/requirement.txt
93+
cd PaddleTest/framework/slice_benchmark
94+
cp ${{ github.workspace }}/../../../apibm_config.yml .
95+
nvidia-smi
96+
bash run.sh
9897
'
9998
10099
- name: Terminate and delete the container
101100
if: always()
102101
run: |
102+
set +e
103103
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
104104
docker rm -f ${{ env.container_name }}

0 commit comments

Comments
 (0)