Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Wenxin Zhang <wenxin.zhang@intel.com>
  • Loading branch information
VincyZhang committed May 15, 2024
1 parent 87b5445 commit 66b9412
Show file tree
Hide file tree
Showing 4 changed files with 348 additions and 22 deletions.
80 changes: 72 additions & 8 deletions .github/workflows/model_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
strategy:
matrix:
include:
- modelName: "facebook/opt-125m"
- modelName: "opt-125m"
datasets: "piqa"
device: "cpu"
tasks: "text-generation"
Expand All @@ -45,6 +45,11 @@ jobs:
steps:
- name: Clean Up Working Directory
run: sudo rm -rf ${{github.workspace}}/*

- name: Load environment variables
if: ${{ matrix.device }} == "cpu"
run:
cat ~/actions-runner4/.env >> $GITHUB_ENV

- name: Checkout out Repo
uses: actions/checkout@v4
Expand All @@ -54,7 +59,7 @@ jobs:
# We need this because GitHub needs to clone the branch to pipeline
- name: Docker Build
run: |
docker build -f ${{ github.workspace }}/.github/workflows/docker/common.dockerfile -t ${{ env.DOCKER_NAME }}:${{ env.DOCKER_TAG }} .
docker build -f ${{ github.workspace }}/.github/workflows/docker/common.dockerfile --build-arg http_proxy="${{ env.HTTP_PROXY_IMAGE_BUILD }}" --build-arg https_proxy="${{ env.HTTPS_PROXY_IMAGE_BUILD }}" -t ${{ env.DOCKER_NAME }}:${{ env.DOCKER_TAG }} .
- name: Docker Run
run: |
Expand All @@ -64,6 +69,7 @@ jobs:
fi
docker run -dit --disable-content-trust --privileged --name=${{ env.CONTAINER_NAME }} -v /dev/shm:/dev/shm \
-v ${{ github.workspace }}:/GenAIEval \
-e http_proxy="${{ env.HTTP_PROXY_IMAGE_BUILD }}" -e https_proxy="${{ env.HTTPS_PROXY_IMAGE_BUILD }}" \
${{ env.DOCKER_NAME }}:${{ env.DOCKER_TAG }}
- name: Binary build
Expand All @@ -86,9 +92,6 @@ jobs:
# skip_unpack: false
# if_no_artifact_found: warn

#- name: Display structure of downloaded files
# run: ls -R

- name: Evaluation
run: |
docker exec ${{ env.CONTAINER_NAME }} \
Expand All @@ -102,15 +105,76 @@ jobs:
&& bash -x collect_log.sh --model=${{ matrix.modelName }} \
--device=${{ matrix.device }} \
--datasets=${{ matrix.datasets }} \
--tasks=${{ matrix.tasks }}
--tasks=${{ matrix.tasks }}"
- name: Publish pipeline artifact
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: ${{ matrix.device }}-${{ matrix.modelName }}
path: |
${{ github.workspace }}/${{ matrix.device }}/${{ matrix.modelName }}
${{ github.workspace }}/.summary.log
${{ github.workspace }}/${{ matrix.device }}-${{ matrix.tasks }}-${{ matrix.modelName }}-${{ matrix.datasets }}.log
${{ github.workspace }}/summary.log
if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn`
retention-days: 60 # 1 <= retention-days <= 90

Genreate-Report:
runs-on: ubuntu-latest
needs: [Evaluation-Workflow]
steps:
- name: Checkout out Repo
uses: actions/checkout@v4

- name: Download Summary Log
uses: actions/download-artifact@v4
with:
path: ${{ env.OUT_SCRIPT_PATH }}/log
- name: Display structure of downloaded files
run: ls -R
- name: Analysis Summary
run: |
cd ${{ env.OUT_SCRIPT_PATH }}
ls -R
- name: Download Reference Artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v3.1.2
with:
workflow: model-test.yml
name: FinalReport
run_id: ${{ vars.ModelTest_REF_ID }}
path: ${{ env.OUT_SCRIPT_PATH }}
name_is_regexp: true
repo: ${{ github.repository }}
check_artifacts: false
search_artifacts: false
skip_unpack: false
if_no_artifact_found: warn

- name: Display structure of downloaded files
run: cd ${{ env.OUT_SCRIPT_PATH }}/log && ls -R

- name: Generate report
run: |
echo "------ Generating final report.html ------"
cd ${{ env.OUT_SCRIPT_PATH }}
/usr/bin/bash generate_report.sh
env:
RUN_DISPLAY_URL: https://https://github.com/opea-project/GenAIEval/actions/runs/${{ github.run_id }}
BUILD_NUMBER: ${{ github.run_id }}
JOB_STATUS: succeed

- name: Publish Report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: FinalReport
path: ${{ env.OUT_SCRIPT_PATH }}/generated

#- name: Specify performance regression
# if: ${{ !cancelled() }}
# run: |
# if [ ${{ env.is_perf_reg }} == 'true' ]; then
# echo "[Performance Regression] Some model performance regression occurred, please check artifacts and reports."
# exit 1
# fi
7 changes: 4 additions & 3 deletions .github/workflows/scripts/models/collect_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.

set -eo pipefail
set -x
source /GenAIEval/.github/workflows/scripts/change_color
WORKSPACE="/GenAIEval"
# get parameters
Expand All @@ -34,14 +35,14 @@ for i in "$@"; do
esac
done

log_file="/GenAIEval/${device}/${model}/${device}-${model}-${tasks}-${datasets}.log"
log_file="/log/${device}/${model}/${device}-${tasks}-${model}-${datasets}.log"
$BOLD_YELLOW && echo "-------- Collect logs --------" && $RESET

echo "working in"
pwd
if [[ ! -f ${log_file} ]]; then
echo "${device};${model};${tasks};${datasets};;${logfile}" >> ${WORKSPACE}/summary.log
else
acc=$(grep -Po "Accuracy .* is:\\s+(\\d+(\\.\\d+)?)" ${log_file} | head -n 1 | sed 's/.*://;s/[^0-9.]//g')
echo "${device};${model};${tasks};${datasets};${acc};${logfile}" >> ${WORKSPACE}/summary.log
acc=$(grep -Po "acc .*(\d+(\.\d+)?)" ${log_file} | awk -F "|" '{print $2}' | head -n 1 | sed 's/.*://;s/[^0-9.]//g')
echo "${device};${model};${tasks};${datasets};${acc};" >> ${WORKSPACE}/summary.log
fi
Loading

0 comments on commit 66b9412

Please sign in to comment.