diff --git a/.github/workflows/_iluvatar_cases.yml b/.github/workflows/_iluvatar_cases.yml new file mode 100644 index 0000000000..702f15a635 --- /dev/null +++ b/.github/workflows/_iluvatar_cases.yml @@ -0,0 +1,70 @@ +name: ILUVATAR-Test + +on: + workflow_call: + inputs: + DOCKER_IMAGE: + description: "Build Images" + required: true + type: string + default: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-ixuca:fd-ci" + FASTDEPLOY_ARCHIVE_URL: + description: "URL of the compressed FastDeploy code archive." + required: true + type: string + CACHE_DIR: + description: "Cache Dir Use" + required: false + type: string + default: "" + MODEL_CACHE_DIR: + description: "Cache Dir Use" + required: false + type: string + default: "" + +jobs: + run_iluvatar_cases: + runs-on: iluvatar-gpu-2 + timeout-minutes: 60 + container: + image: ${{ inputs.DOCKER_IMAGE }} + env: + LD_LIBRARY_PATH: /usr/local/corex/lib + LIBRARY_PATH: /usr/local/corex/lib + steps: + - name: Print current runner name + run: | + echo "Current runner name: ${{ runner.name }}" + - name: Code Prepare + shell: bash + env: + docker_image: ${{ inputs.DOCKER_IMAGE }} + fd_archive_url: ${{ inputs.FASTDEPLOY_ARCHIVE_URL }} + run: | + set -x + REPO="https://github.com/${{ github.repository }}.git" + FULL_REPO="${{ github.repository }}" + REPO_NAME="${FULL_REPO##*/}" + BASE_BRANCH="${{ github.base_ref }}" + # Clean the repository directory before starting + if [ -d ${REPO_NAME} ]; then + echo "Directory ${REPO_NAME} exists, removing it..." + rm -rf ${REPO_NAME}* + fi + git config --global --add safe.directory '*' + wget -q ${fd_archive_url} + tar -xf FastDeploy.tar.gz + rm -rf FastDeploy.tar.gz + cd FastDeploy + git config --global user.name "FastDeployCI" + git config --global user.email "fastdeploy_ci@example.com" + git log -n 3 --oneline + + - name: Run CI unittest + env: + CACHE_DIR: ${{ inputs.CACHE_DIR }} + MODEL_CACHE_DIR: ${{ inputs.MODEL_CACHE_DIR }} + run: | + cd FastDeploy + bash scripts/run_ci_iluvatar.sh diff --git a/.github/workflows/ci_iluvatar.yml b/.github/workflows/ci_iluvatar.yml index 6d64c2e9c5..b3bab67e29 100644 --- a/.github/workflows/ci_iluvatar.yml +++ b/.github/workflows/ci_iluvatar.yml @@ -1,88 +1,23 @@ -name: CI_ILUVATAR - +name: ILUVATAR-CI on: pull_request: - branches: [ develop ] - workflow_dispatch: + types: [opened, synchronize] + branches: [develop, release/**] +permissions: read-all concurrency: - group: ${{ github.event.pull_request.number }}-iluvatar-ci + group: ${{ github.event.pull_request.number }}-${{ github.workflow }} cancel-in-progress: true jobs: - CI_ILUVATAR: - runs-on: [self-hosted, ILUVATAR_8Card] - steps: - - name: Print current runner name - run: | - echo "Current runner name: ${{ runner.name }}" - # Because the system version is lower than 2.23, the checkout cannot be used. - # - name: Checkout code - # uses: actions/checkout@v4 + clone: + name: FD-Clone-Linux + uses: ./.github/workflows/_clone_linux.yml - - name: Code Checkout - env: - docker_image: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-ixuca:paddle-ocr-vl-1107 - run: | - REPO="https://github.com/${{ github.repository }}.git" - FULL_REPO="${{ github.repository }}" - REPO_NAME="${FULL_REPO##*/}" - BASE_BRANCH="${{ github.base_ref }}" - # Clean the repository directory before starting - docker run --rm --net=host -v $(pwd):/workspace -w /workspace \ - -e "REPO_NAME=${REPO_NAME}" \ - -e "BASE_BRANCH=${BASE_BRANCH}" \ - ${docker_image} /bin/bash -c ' - if [ -d ${REPO_NAME} ]; then - echo "Directory ${REPO_NAME} exists, removing it..." - rm -rf ${REPO_NAME} - fi - ' - git config --global http.proxy "http://61.151.249.150:33128" - git config --global https.proxy "http://61.151.249.150:33128" - git config --global user.name "FastDeployCI" - git config --global user.email "fastdeploy_ci@example.com" - git clone --recursive ${REPO} ${REPO_NAME} -b ${BASE_BRANCH} - cd FastDeploy - if [ "${{ github.event_name }}" = "pull_request" ]; then - git fetch origin pull/${{ github.event.pull_request.number }}/head:pr/${{ github.event.pull_request.number }} - git merge pr/${{ github.event.pull_request.number }} - git log -n 3 --oneline - else - git checkout ${{ github.sha }} - git log -n 3 --oneline - fi - - - name: Run CI unittest - env: - docker_image: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-ixuca:paddle-ocr-vl-1107 - run: | - runner_name="${{ runner.name }}" - last_char="${runner_name: -1}" - - if [[ "$last_char" =~ [0-3] ]]; then - gpu_id="$last_char" - else - gpu_id="0" - fi - FD_API_PORT=$((9180 + gpu_id * 100)) - FD_ENGINE_QUEUE_PORT=$((9150 + gpu_id * 100)) - FD_METRICS_PORT=$((9170 + gpu_id * 100)) - - PARENT_DIR=$(dirname "$WORKSPACE") - echo "PARENT_DIR:$PARENT_DIR" - docker run --rm --net=host --pid=host --cap-add=ALL --privileged --shm-size=64G \ - -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /dev:/dev \ - -v $(pwd):/workspace -w /workspace \ - -v "/data1/fastdeploy:/data1/fastdeploy" \ - -e "MODEL_PATH=/ssd3/model" \ - -e "http_proxy=$(git config --global --get http.proxy)" \ - -e "https_proxy=$(git config --global --get https.proxy)" \ - -e "FD_API_PORT=${FD_API_PORT}" \ - -e "FD_ENGINE_QUEUE_PORT=${FD_ENGINE_QUEUE_PORT}" \ - -e "FD_METRICS_PORT=${FD_METRICS_PORT}" \ - ${docker_image} /bin/bash -c " - git config --global --add safe.directory /workspace/FastDeploy - cd FastDeploy - bash scripts/run_ci_iluvatar.sh - " + iluvatar_test: + name: Run iluvatar Tests + needs: [clone] + uses: ./.github/workflows/_iluvatar_cases.yml + with: + DOCKER_IMAGE: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-ixuca:fd-ci + FASTDEPLOY_ARCHIVE_URL: ${{ needs.clone.outputs.repo_archive_url }} diff --git a/scripts/run_ci_iluvatar.sh b/scripts/run_ci_iluvatar.sh index d2e00786c8..bfc2897fb1 100644 --- a/scripts/run_ci_iluvatar.sh +++ b/scripts/run_ci_iluvatar.sh @@ -14,8 +14,13 @@ ln -sf /usr/local/bin/python3 /usr/local/bin/python echo "pip requirements" python -m pip install -r requirements_iluvatar.txt echo "install paddle cpu and custom device" -python -m pip install paddlepaddle==3.3.0.dev20251103 -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/ -python -m pip install paddle-iluvatar-gpu==3.0.0.dev20251107 -i https://www.paddlepaddle.org.cn/packages/nightly/ixuca/ +python -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/ +python -m pip install --pre paddle-iluvatar-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/ixuca/ +#python -m pip install paddlepaddle==3.3.0.dev20251219 -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/ +#python -m pip install paddle-iluvatar-gpu==3.0.0.dev20251223 -i https://www.paddlepaddle.org.cn/packages/nightly/ixuca/ +mkdir -p /model_data/ +cp -r /aistudio/paddle_ci/ERNIE_300B_4L/ /model_data/ +cp -r /aistudio/paddle_ci/ERNIE-4.5-VL-28B-A3B-Paddle /model_data/ echo "build whl" bash build.sh || exit 1 diff --git a/tests/ci_use/iluvatar_UT/run_ernie300B_4layer.py b/tests/ci_use/iluvatar_UT/run_ernie300B_4layer.py index de0e3e9304..96be13334d 100644 --- a/tests/ci_use/iluvatar_UT/run_ernie300B_4layer.py +++ b/tests/ci_use/iluvatar_UT/run_ernie300B_4layer.py @@ -33,7 +33,7 @@ def offline_infer_check(): ] sampling_params = SamplingParams(temperature=0.8, top_p=0.00001, max_tokens=16) llm = LLM( - model="/data1/fastdeploy/ERNIE_300B_4L", + model="/model_data/ERNIE_300B_4L", tensor_parallel_size=2, max_model_len=8192, quantization="wint8", diff --git a/tests/ci_use/iluvatar_UT/run_ernie_vl_28B.py b/tests/ci_use/iluvatar_UT/run_ernie_vl_28B.py index 8efba5c99f..d257be0434 100644 --- a/tests/ci_use/iluvatar_UT/run_ernie_vl_28B.py +++ b/tests/ci_use/iluvatar_UT/run_ernie_vl_28B.py @@ -33,7 +33,7 @@ from ci_use.iluvatar_UT.utils import TIMEOUT_MSG, timeout def offline_infer_check(): set_random_seed(123) - PATH = "/data1/fastdeploy/ERNIE-4.5-VL-28B-A3B-Paddle" + PATH = "/model_data/ERNIE-4.5-VL-28B-A3B-Paddle" tokenizer = Ernie4_5Tokenizer.from_pretrained(PATH) messages = [