Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/Api-Benchmark-baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Api-benchmark-baseline

on:
workflow_dispatch:
inputs:
PR_ID:
required: false
type: string
COMMIT_ID:
required: false
type: string
job-name:
required: true
default: 'api-benchmark'
type: choice
options:
- api-benchmark
- others
schedule:
- cron: '0 21 * * *'
- cron: '0 22 * * 3'

permissions: read-all

defaults:
run:
shell: bash

jobs:
clone:
name: Api benchmark clone
if: github.event.schedule == '0 21 * * *'
uses: ./.github/workflows/_Clone-linux.yml
with:
clone_dir: Paddle-build
is_pr: 'false'

build-docker:
name: Api benchmark build docker
if: github.event.schedule == '0 21 * * *'
needs: clone
uses: ./.github/workflows/docker.yml
with:
clone_dir: Paddle-build
task: build

build:
name: Api benchmark build
if: github.event.schedule == '0 21 * * *'
needs: [clone, build-docker]
uses: ./.github/workflows/_Linux-build.yml
with:
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
is_pr: 'false'

api-benchmark-baseline:
name: Api benchmark baseline
if: github.event.schedule == '0 21 * * *' || github.event.inputs.job-name == 'api-benchmark'
strategy:
matrix:
run-labels: [api-bm-20, api-bm-27]
uses: ./.github/workflows/_Api-Benchmark.yml
needs: [clone, build-docker, build]
with:
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
baseline: 'true'
MANUALLY_PR_ID: ${{ inputs.PR_ID }}
MANUALLY_COMMIT_ID: ${{ inputs.COMMIT_ID }}
run-labels: ${{ matrix.run-labels }}

test1:
runs-on: ubuntu-latest
if: github.event.schedule == '0 0 * * *'
steps:
- name: Test
run: |
echo "test1"

test2:
runs-on: ubuntu-latest
if: github.event.schedule == '0 21 * * *'
steps:
- name: Test
run: |
echo "test2"

test3:
runs-on: ubuntu-latest
if: github.event.schedule == '0 22 * * 3'
steps:
- name: Test
run: |
echo "test3"

test4:
runs-on: ubuntu-latest
if: github.event.schedule == '0 21 * * 1'
steps:
- name: Test
run: |
echo "test4"
29 changes: 26 additions & 3 deletions .github/workflows/_Api-Benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@ on:
can-skip:
type: string
required: false
baseline:
type: string
required: false
default: "false"
MANUALLY_PR_ID:
type: string
required: false
MANUALLY_COMMIT_ID:
type: string
required: false
run-labels:
type: string
required: false
default: "api-bm"

env:
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
PR_ID: ${{ github.event.pull_request.number || '0' }}
COMMIT_ID: ${{ github.event.pull_request.head.sha || github.sha }}
work_dir: /paddle
PADDLE_ROOT: /paddle
TASK: paddle-CI-${{ github.event.pull_request.number }}-api-benchmark
Expand Down Expand Up @@ -40,6 +54,7 @@ jobs:
if: ${{ inputs.can-skip != 'true' && needs.check-bypass.outputs.can-skip != 'true' }}
runs-on:
group: Api-bm
labels: [self-hosted, "${{ inputs.run-labels }}"]
steps:
- name: Determine the runner
run: |
Expand Down Expand Up @@ -117,7 +132,15 @@ jobs:
cd ./PaddleTest/framework/e2e/api_benchmark_new
cp /paddle/PTSTools/Uploader/apibm_config.yml .
source ${{ github.workspace }}/../../../proxy
${python} -m pip install https://paddle-github-action.bj.bcebos.com/PR/build/${PR_ID}/${COMMIT_ID}/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
${python} -m pip install $wheel_link
if [[ "${{ inputs.baseline }}" == "true" ]];then
if [[ "${{ inputs.MANUALLY_PR_ID }}" == "" ]]; then
${python} runner_ci_action.py --yaml ../yaml/api_benchmark_fp32.yml --baseline_whl_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
else
${python} runner_ci_action.py --yaml ../yaml/api_benchmark_fp32.yml --baseline_whl_link https://paddle-github-action.bj.bcebos.com/PR/build/${{ inputs.MANUALLY_PR_ID }}/${{ inputs.MANUALLY_COMMIT_ID }}/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
fi
exit 0
fi
if [ ${core_index} -eq -1 ];then
${python} runner_ci_action.py --yaml ../yaml/api_benchmark_fp32.yml --core_index 2
else
Expand Down