Skip to content

Commit 511a040

Browse files
authored
Merge branch 'develop' into develop
2 parents 5a8a748 + 4842b58 commit 511a040

File tree

7,017 files changed

+502110
-447890
lines changed

Some content is hidden

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

7,017 files changed

+502110
-447890
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Paddle Repos Sync Triggered by Commit Using Repository Dispatch
2+
run-name: Paddle repos sync runs triggered by commit using ${{ github.event_name }}
3+
on:
4+
repository_dispatch:
5+
types: [sync-event-commit]
6+
7+
jobs:
8+
paddleqa-checkout:
9+
environment: CodeSync
10+
runs-on: ubuntu-latest
11+
name: Repo Checkout and Upload
12+
steps:
13+
- name: PaddleTest Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
sparse-checkout: |
17+
tools
18+
- name: Code Checkout
19+
id: checkout
20+
uses: XieYunshen/[email protected]
21+
with:
22+
repository: ${{ github.event.client_payload.repository }}
23+
ref: ${{ github.event.client_payload.ref }}
24+
submodules: ${{ github.event.client_payload.submodules }}
25+
fetch_depth: ${{ github.event.client_payload.fetch_depth }}
26+
path: ${{ github.event.client_payload.path }}
27+
commit_sha: ${{ github.event.client_payload.commit_sha }}
28+
repo_compress: ${{ github.event.client_payload.repo_compress }}
29+
- uses: actions/setup-python@v5
30+
with:
31+
python-version: '3.10'
32+
- name: Upload Code
33+
env:
34+
AK: ${{ secrets.BOS_AK }}
35+
SK: ${{ secrets.BOS_SK }}
36+
run: |
37+
git log -n 3
38+
tree -L 3
39+
current_commit=$(git rev-parse HEAD)
40+
REPO_NAME=${{ github.event.client_payload.repository }}
41+
REPO_NAME=${REPO_NAME##*/}
42+
file_name=$REPO_NAME.tar
43+
cd ${{ github.event.client_payload.path }}
44+
current_commit=$(git rev-parse HEAD)
45+
current_commit_time=$(git show -s --format=%ct HEAD)
46+
cd -
47+
tar -cf $REPO_NAME.tar ${{ github.event.client_payload.path }}
48+
python -m pip install bce-python-sdk==0.8.74
49+
# 获取远端的最新提交时间
50+
latest_commit_time_remote=$(curl --silent --fail https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/${{ github.event.client_payload.commit_sha }}/latest_commit_time) || latest_commit_time_remote=0
51+
# 判断 latest_commit_time_remote 是否晚于 current_commit_time 时间
52+
if [ -n "$latest_commit_time_remote" ] && [ "$latest_commit_time_remote" -lt "$current_commit_time" ]; then
53+
echo "Executing upload as latest commit time ($latest_commit_time_remote) is earlier than current commit time ($current_commit_time)."
54+
python tools/bos_upload.py ${file_name} paddle-qa/CodeSync/${{ github.event.client_payload.ref }}/${{ github.event.client_payload.commit_sha }}
55+
echo "Bos link: https://paddle-qa.bj.bcebos.com/CodeSync/${{ github.event.client_payload.ref }}/${{ github.event.client_payload.commit_sha }}/$file_name"
56+
echo "${current_commit_time}" >> latest_commit_time
57+
python tools/bos_upload.py latest_commit_time paddle-qa/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/${{ github.event.client_payload.commit_sha }}
58+
echo "${current_commit}" >> latest_commit
59+
python tools/bos_upload.py latest_commit paddle-qa/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/${{ github.event.client_payload.commit_sha }}
60+
echo "GitInfo link: https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/${{ github.event.client_payload.commit_sha }}/latest_commit_sha"
61+
echo "GitInfo link: https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/${{ github.event.client_payload.commit_sha }}/latest_commit_time"
62+
else
63+
echo "The latest commit time is later than the current commit. Skipping the commit operation."
64+
fi
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Paddle kits repos sync via repository_dispatch
2+
run-name: Paddle kits repos sync Runs on ${{ github.event_name }}
3+
on:
4+
repository_dispatch:
5+
types: [sync-event]
6+
7+
jobs:
8+
paddleqa-checkout:
9+
environment: CodeSync
10+
runs-on: ubuntu-latest
11+
concurrency:
12+
group: exclusive-group-${{ github.workflow }}-${{ github.event.client_payload.repository }}-${{ github.event.client_payload.ref }}
13+
cancel-in-progress: false
14+
name: Repo Checkout and Upload
15+
steps:
16+
- name: PaddleTest Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
sparse-checkout: |
20+
tools
21+
- name: Code Checkout
22+
id: checkout
23+
uses: XieYunshen/[email protected]
24+
with:
25+
repository: ${{ github.event.client_payload.repository }}
26+
ref: ${{ github.event.client_payload.ref }}
27+
submodules: ${{ github.event.client_payload.submodules }}
28+
fetch_depth: ${{ github.event.client_payload.fetch_depth }}
29+
path: ${{ github.event.client_payload.path }}
30+
commit_sha: ${{ github.event.client_payload.commit_sha }}
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.10'
34+
- name: Upload Code
35+
env:
36+
AK: ${{ secrets.BOS_AK }}
37+
SK: ${{ secrets.BOS_SK }}
38+
run: |
39+
git log -n 3
40+
current_commit=$(git rev-parse HEAD)
41+
tree -L 3
42+
REPO_NAME=${{ github.event.client_payload.repository }}
43+
REPO_NAME=${REPO_NAME##*/}
44+
file_name=$REPO_NAME.tar
45+
cd ${{ github.event.client_payload.path }}
46+
current_commit=$(git rev-parse HEAD)
47+
current_commit_time=$(git show -s --format=%ct HEAD)
48+
cd -
49+
tar -cf $REPO_NAME.tar ${{ github.event.client_payload.path }}
50+
python -m pip install bce-python-sdk==0.8.74
51+
# 获取远端的最新提交时间
52+
latest_commit_time_remote=$(curl --silent --fail https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/latest_commit_time) || latest_commit_time_remote=0
53+
# 判断 latest_commit_time_remote 是否晚于 current_commit_time 时间
54+
if [ -n "$latest_commit_time_remote" ] && [ "$latest_commit_time_remote" -lt "$current_commit_time" ]; then
55+
echo "Executing upload as latest commit time ($latest_commit_time_remote) is earlier than current commit time ($current_commit_time)."
56+
python tools/bos_upload.py ${file_name} paddle-qa/CodeSync/${{ github.event.client_payload.ref }}/
57+
echo "Bos link: https://paddle-qa.bj.bcebos.com/CodeSync/${{ github.event.client_payload.ref }}/$file_name"
58+
echo "${current_commit_time}" >> latest_commit_time
59+
python tools/bos_upload.py latest_commit_time paddle-qa/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}
60+
echo "${current_commit}" >> latest_commit
61+
python tools/bos_upload.py latest_commit paddle-qa/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}
62+
echo "GitInfo link: https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/latest_commit_sha"
63+
echo "GitInfo link: https://paddle-qa.bj.bcebos.com/CodeSync/GitInfo/${{ github.event.client_payload.repository }}/${{ github.event.client_payload.ref }}/latest_commit_time"
64+
else
65+
echo "The latest commit time is later than the current commit. Skipping the commit operation."
66+
fi

.github/workflows/repo_sync.yml renamed to .github/workflows/repo_sync_paddlex_use.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Paddle kits repos sync
2-
run-name: Paddle kits repos sync Runs on ${{ github.event_name }}
1+
name: PaddleX kits repos sync
2+
run-name: PaddleX kits repos sync Runs on ${{ github.event_name }}
33
on:
44
workflow_dispatch:
55
repository_dispatch:
@@ -11,6 +11,7 @@ on:
1111
jobs:
1212
paddleqa-checkout:
1313
if: ${{ !github.event.repository.fork }}
14+
environment: CodeSync
1415
runs-on: ubuntu-latest
1516
name: Repo Checkout and Upload
1617
strategy:
@@ -47,6 +48,16 @@ jobs:
4748
submodules: "false"
4849
fetch_depth: 1
4950
path: "PaddleNLP"
51+
- repository: "PaddlePaddle/PaddleVideo"
52+
ref: "develop"
53+
submodules: "false"
54+
fetch_depth: 1
55+
path: "PaddleVideo"
56+
- repository: "PaddlePaddle/Paddle3D"
57+
ref: "develop"
58+
submodules: "false"
59+
fetch_depth: 1
60+
path: "Paddle3D"
5061
steps:
5162
- name: PaddleTest Checkout
5263
uses: actions/checkout@v4

.github/workflows/run_check.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: PaddlePaddle Packages Run Check
2+
run-name: Runs on ${{ github.event_name }}
3+
4+
on:
5+
workflow_dispatch:
6+
workflow_call:
7+
schedule:
8+
- cron: "0 20 * * *"
9+
10+
jobs:
11+
run-check:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-20.04, ubuntu-latest, macos-latest, macos-13, ubuntu-24.04-arm, windows-latest] # x86 和 ARM
16+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
17+
18+
steps:
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Upgrade pip and install setuptools
25+
run: python -m pip install --upgrade pip setuptools
26+
27+
- name: Install dependencies
28+
run: python -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
29+
30+
- name: Run Check
31+
run: |
32+
python -c "import paddle; paddle.version.show(); paddle.utils.run_check()"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: tools file sync to bos
2+
run-name: Tools file synchronization
3+
on:
4+
push:
5+
paths:
6+
- 'tools/bos_upload.py'
7+
- 'tools/linux_env_info.sh'
8+
- 'tools/bos_tools.py'
9+
workflow_dispatch:
10+
11+
jobs:
12+
upload_bos:
13+
if: ${{ !github.event.repository.fork }}
14+
environment: CodeSync
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: PaddleTest Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
sparse-checkout: |
21+
tools
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
- name: Upload Code
26+
env:
27+
AK: ${{ secrets.BOS_AK }}
28+
SK: ${{ secrets.BOS_SK }}
29+
run: |
30+
tree -L 3
31+
echo "Repository: ${{ github.repository }}"
32+
echo "Branch: ${{ github.ref }}"
33+
python -m pip install bce-python-sdk==0.8.74
34+
branch=$(echo '${{ github.ref }}' | sed 's#refs/heads/##')
35+
python tools/bos_upload.py tools/bos_upload.py paddle-qa/CodeSync/${branch}/${{ github.repository }}
36+
python tools/bos_upload.py tools/bos_tools.py paddle-qa/CodeSync/${branch}/${{ github.repository }}
37+
python tools/bos_upload.py tools/linux_env_info.sh paddle-qa/CodeSync/${branch}/${{ github.repository }}

.github/workflows/source_sync.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
1-
name: source code sync to bos
2-
run-name: Source code synchronization
1+
name: PaddleTest sync to bos
2+
run-name: PaddleTest synchronization
33
on:
44
workflow_dispatch:
5+
push:
56
jobs:
67
upload_bos:
78
if: ${{ !github.event.repository.fork }}
9+
environment: CodeSync
810
runs-on: ubuntu-latest
911
steps:
10-
- name: code-clone-upload
12+
- name: PaddleTest Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
sparse-checkout: |
16+
tools
17+
- name: Code Checkout
18+
id: checkout
19+
uses: XieYunshen/[email protected]
20+
with:
21+
repository: "PaddlePaddle/PaddleTest"
22+
ref: "develop"
23+
submodules: "false"
24+
fetch_depth: 20
25+
path: "PaddleTest"
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.10'
29+
- name: Upload Code
1130
env:
1231
AK: ${{ secrets.BOS_AK }}
1332
SK: ${{ secrets.BOS_SK }}
14-
uses: docker://xieyunshen2020/paddleqa:code-clone-git2.34
15-
with:
16-
entrypoint: /bin/sh
17-
args: |
18-
-c "
19-
git clone https://github.com/PaddlePaddle/PaddleTest.git --depth=10
20-
tar -zcf PaddleTest_workflow.tar.gz PaddleTest
21-
python3 ./PaddleTest/tools/bos_upload.py PaddleTest_workflow.tar.gz xly-devops/PaddleTest
22-
"
33+
run: |
34+
tree -L 3
35+
path=PaddleTest
36+
REPO_NAME=PaddleTest
37+
file_name=$REPO_NAME.tar.gz
38+
tar -zcf ${file_name} ${path}
39+
python -m pip install bce-python-sdk==0.8.74
40+
python tools/bos_upload.py ${file_name} xly-devops/PaddleTest
41+
echo "Bos link: https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz"

distributed/CE_API/case/dist_CountFilterEntry.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ def test_CountFilterEntry():
2929
sparse_feature_dim = 1024
3030
embedding_size = 64
3131

32-
entry = paddle.distributed.CountFilterEntry(10)
32+
# entry = paddle.distributed.CountFilterEntry(10)
3333

3434
input = paddle.static.data(name="ins", shape=[1], dtype="int64")
3535

36-
emb = paddle.static.nn.sparse_embedding(
37-
input=input,
38-
size=[sparse_feature_dim, embedding_size],
39-
is_test=False,
40-
entry=entry,
41-
param_attr=paddle.ParamAttr(name="SparseFeatFactors", initializer=paddle.nn.initializer.Uniform()),
36+
Emb = paddle.nn.Embedding(
37+
num_embeddings=sparse_feature_dim,
38+
embedding_dim=embedding_size,
39+
sparse=True,
40+
weight_attr=paddle.ParamAttr(name="SparseFeatFactors", initializer=paddle.nn.initializer.Uniform()),
4241
)
42+
emb = Emb(input)
4343
print(emb)
4444
print("test_CountFilterEntry ... ok")
4545

distributed/CE_API/case/dist_ProbabilityEntry.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ def test_ProbabilityEntry():
2929
sparse_feature_dim = 1024
3030
embedding_size = 64
3131

32-
entry = paddle.distributed.ProbabilityEntry(0.1)
32+
# entry = paddle.distributed.ProbabilityEntry(0.1)
3333

3434
input = paddle.static.data(name="ins", shape=[1], dtype="int64")
3535

36-
emb = paddle.static.nn.sparse_embedding(
37-
input=input,
38-
size=[sparse_feature_dim, embedding_size],
39-
is_test=False,
40-
entry=entry,
41-
param_attr=paddle.ParamAttr(name="SparseFeatFactors", initializer=paddle.nn.initializer.Uniform()),
36+
Emb = paddle.nn.Embedding(
37+
num_embeddings=sparse_feature_dim,
38+
embedding_dim=embedding_size,
39+
sparse=True,
40+
weight_attr=paddle.ParamAttr(name="SparseFeatFactors", initializer=paddle.nn.initializer.Uniform()),
4241
)
42+
emb = Emb(input)
4343
print(emb)
4444
print("test_ProbabilityEntry ... ok")
4545

distributed/CE_API/case/dist_ShowClickEntry.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ def test_ShowClickEntry():
3434
# clicks = paddle.static.data(name="click", shape=[1], dtype="int64")
3535
input = paddle.static.data(name="ins", shape=[1], dtype="int64")
3636

37-
entry = paddle.distributed.ShowClickEntry("show", "click")
38-
39-
emb = paddle.static.nn.sparse_embedding(
40-
input=input,
41-
size=[sparse_feature_dim, embedding_size],
42-
is_test=False,
43-
entry=entry,
44-
param_attr=paddle.ParamAttr(name="SparseFeatFactors", initializer=paddle.nn.initializer.Uniform()),
37+
# entry = paddle.distributed.ShowClickEntry("show", "click")
38+
39+
Emb = paddle.nn.Embedding(
40+
num_embeddings=sparse_feature_dim,
41+
embedding_dim=embedding_size,
42+
sparse=True,
43+
weight_attr=paddle.ParamAttr(name="SparseFeatFactors", initializer=paddle.nn.initializer.Uniform()),
4544
)
46-
assert emb.shape == (64,)
45+
emb = Emb(input)
46+
print(emb.shape)
4747

4848
print("test_ShowClickEntry ... ok")
4949

distributed/CE_API/case/dist_fleet_qat_init.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ def run_example_code():
3737
exe = paddle.static.Executor(place)
3838
# 1. Define the train program
3939
data = paddle.static.data(name="X", shape=[None, 1, 28, 28], dtype="float32")
40-
conv2d = paddle.static.nn.conv2d(input=data, num_filters=6, filter_size=3)
41-
bn = paddle.static.nn.batch_norm(input=conv2d, act="relu")
40+
Conv = paddle.nn.Conv2D(in_channels=1, out_channels=6, kernel_size=3)
41+
conv2d = Conv(data)
42+
bn = paddle.nn.BatchNorm2D(6)(conv2d)
4243
pool = F.max_pool2d(bn, kernel_size=2, stride=2)
4344
hidden = paddle.static.nn.fc(pool, size=10)
4445
loss = paddle.mean(hidden)

0 commit comments

Comments
 (0)