Skip to content

Commit b8611a2

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into Tensor
2 parents 3789759 + cbedff7 commit b8611a2

File tree

225 files changed

+7358
-4034
lines changed

Some content is hidden

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

225 files changed

+7358
-4034
lines changed

.github/workflows/Api-Benchmark-baseline.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
is_pr: 'false'
5252

5353
api-benchmark-baseline-schedule:
54-
name: Api benchmark baseline
54+
name: Api benchmark baseline with schedule
5555
strategy:
5656
matrix:
5757
run-labels: [api-bm-20, api-bm-27]
@@ -62,17 +62,26 @@ jobs:
6262
baseline: 'true'
6363
run-labels: ${{ matrix.run-labels }}
6464

65-
api-benchmark-baseline-pr:
66-
name: Api benchmark baseline
65+
api-benchmark-baseline-pr-20:
66+
name: Api benchmark baseline with PR on 20
6767
if: github.event_name == 'workflow_dispatch' && github.event.inputs.job-name == 'api-benchmark'
68-
strategy:
69-
matrix:
70-
run-labels: [api-bm-20, api-bm-27]
7168
uses: ./.github/workflows/_Api-Benchmark.yml
7269
needs: [clone, build-docker]
7370
with:
7471
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
7572
baseline: 'true'
7673
MANUALLY_PR_ID: ${{ inputs.PR_ID }}
7774
MANUALLY_COMMIT_ID: ${{ inputs.COMMIT_ID }}
78-
run-labels: ${{ matrix.run-labels }}
75+
run-labels: api-bm-20
76+
77+
api-benchmark-baseline-pr-27:
78+
name: Api benchmark baseline with PR on 27
79+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.job-name == 'api-benchmark'
80+
uses: ./.github/workflows/_Api-Benchmark.yml
81+
needs: [clone, build-docker]
82+
with:
83+
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
84+
baseline: 'true'
85+
MANUALLY_PR_ID: ${{ inputs.PR_ID }}
86+
MANUALLY_COMMIT_ID: ${{ inputs.COMMIT_ID }}
87+
run-labels: api-bm-27

.github/workflows/_Api-Benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ env:
3131
PADDLE_ROOT: /paddle
3232
TASK: paddle-CI-${{ github.event.pull_request.number }}-api-benchmark
3333
ci_scripts: /paddle/ci
34-
BRANCH: ${{ github.event.pull_request.base.ref }}
34+
BRANCH: ${{ github.event.pull_request.base.ref || github.ref_name }}
3535
CI_name: api-benchmark
3636
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
3737

.pre-commit-config.yaml

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -55,116 +55,12 @@ repos:
5555
- id: typos
5656
args: [--force-exclude]
5757
# For Python files
58-
- repo: https://github.com/psf/black-pre-commit-mirror
59-
rev: 25.1.0
60-
hooks:
61-
- id: black
62-
exclude: |
63-
(?x)^(
64-
ci/.+
65-
66-
| cmake/.+
67-
68-
| r/.+
69-
70-
| paddle/scripts/.+
71-
72-
| setup.py
73-
74-
| paddle/.+
75-
76-
| python/paddle/[a-c].+
77-
78-
| python/paddle/de.+
79-
80-
| python/paddle/distributed/a.+
81-
82-
| python/paddle/distributed/[b-e].+
83-
84-
| python/paddle/distributed/f.+
85-
86-
| python/paddle/distributed/[g-z].+
87-
88-
| python/paddle/[e-i].+
89-
90-
| python/paddle/j.+
91-
92-
| python/paddle/[k-n].+
93-
94-
| python/paddle/[o-t].+
95-
96-
| python/paddle/[u-z].+
97-
98-
| python/_.+
99-
100-
# | test/a.+
101-
102-
# | test/[b-h].+
103-
104-
| test/[i-k].+
105-
106-
# | test/l.+
107-
108-
| test/[m-z].+
109-
110-
| tools/.+
111-
)$
11258
- repo: https://github.com/astral-sh/ruff-pre-commit
11359
rev: v0.12.0
11460
hooks:
11561
- id: ruff-check
11662
args: [--fix, --exit-non-zero-on-fix, --no-cache]
11763
- id: ruff-format
118-
exclude: |
119-
(?x)^(
120-
# ci/.+
121-
122-
# | cmake/.+
123-
124-
# | r/.+
125-
126-
# | paddle/scripts/.+
127-
128-
# | setup.py
129-
130-
# | paddle/.+
131-
132-
# | python/paddle/[a-c].+
133-
134-
# | python/paddle/de.+
135-
136-
# | python/paddle/distributed/a.+
137-
138-
# | python/paddle/distributed/[b-e].+
139-
140-
# | python/paddle/distributed/f.+
141-
142-
# | python/paddle/distributed/[g-z].+
143-
144-
# | python/paddle/[e-i].+
145-
146-
# | python/paddle/j.+
147-
148-
# | python/paddle/[k-n].+
149-
150-
# | python/paddle/[o-t].+
151-
152-
# | python/paddle/[u-z].+
153-
154-
# | python/_.+
155-
156-
| test/a.+
157-
158-
| test/[b-h].+
159-
160-
# | test/[i-k].+
161-
162-
| test/l.+
163-
164-
# | test/[m-z].+
165-
166-
# | tools/.+
167-
)$
16864
# For C++ files
16965
- repo: local
17066
hooks:

ci/coverage_test.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ function is_run_distribute_in_op_test() {
2424
echo "export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1" >> "$HOME/.bashrc"
2525
fi
2626
done
27-
ALL_CHANGE_FILES=`git diff --numstat upstream/$BRANCH | awk '{print $3}' | grep ".py"|| true`
27+
ALL_CHANGE_FILES=$(git diff --name-only upstream/$BRANCH | grep ".py"|| true)
2828
echo ${ALL_CHANGE_FILES}
2929
for CHANGE_FILE in ${ALL_CHANGE_FILES}; do
30-
ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH ${PADDLE_ROOT}/${CHANGE_FILE} | grep "+" | grep "check_auto_parallel=" || true`
30+
TARGET_FILE="${PADDLE_ROOT}/${CHANGE_FILE}"
31+
if [ ! -f "$TARGET_FILE" ]; then
32+
continue
33+
fi
34+
ALL_OPTEST_BAN_AUTO_PARALLEL_TEST=`git diff -U0 upstream/$BRANCH "TARGET_FILE" | grep "+" | grep "check_auto_parallel=" || true`
3135
if [ "${ALL_OPTEST_BAN_AUTO_PARALLEL_TEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
3236
export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1
3337
echo "export FLAGS_COVERAGE_RUN_AUTO_PARALLEL_IN_OP_TEST=1" >> "$HOME/.bashrc"

paddle/fluid/eager/auto_code_generator/generator/codegen_utils.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,8 @@ def __init__(self, forward_api_contents, namespace):
499499
self.dygraph_pre_process = (
500500
"" # The pre_process function calling code for dygraph
501501
)
502-
self.static_pre_process = (
503-
"" # The pre_process function calling code for static graph
504-
)
505-
self.args_parser_func_name = "" # The custom args parser function
502+
503+
self.args_mapper_func_name = None # The custom args parser function
506504
self.python_api_names = ""
507505

508506
def ParseForwardInplaceInfo(self):
@@ -535,20 +533,19 @@ def ParsePythonAPIInfo(self):
535533
self.args_alias_map = args_alias
536534
if 'pre_process' in python_api_info.keys():
537535
pre_process = python_api_info['pre_process']
538-
if 'func' in pre_process.keys():
539-
self.dygraph_pre_process = pre_process['func']
540-
self.static_pre_process = pre_process['func']
541-
# TODO check len(pre_process) > 1
542-
543-
if 'dygraph_func' in pre_process.keys():
544-
self.dygraph_pre_process = pre_process['dygraph_func']
545-
if 'static_func' in pre_process.keys():
546-
self.static_pre_process = pre_process['static_func']
547-
if (
548-
'args_parser' in python_api_info.keys()
549-
and 'func' in python_api_info['args_parser']
550-
):
551-
self.args_parser_func_name = python_api_info['args_parser']['func']
536+
if pre_process is not None:
537+
if 'dygraph_func' in pre_process.keys():
538+
self.dygraph_pre_process = pre_process['dygraph_func']
539+
elif 'func' in pre_process.keys():
540+
self.dygraph_pre_process = pre_process['func']
541+
542+
if 'args_mapper' in python_api_info.keys():
543+
args_mapper = python_api_info['args_mapper']
544+
if args_mapper is not None:
545+
if 'dygraph_func' in args_mapper.keys():
546+
self.args_mapper_func_name = args_mapper['dygraph_func']
547+
elif 'func' in args_mapper.keys():
548+
self.args_mapper_func_name = args_mapper['func']
552549

553550
def ParseNoNeedBuffer(self):
554551
grad_api_contents = self.grad_api_contents

0 commit comments

Comments
 (0)