-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from DocsaidLab/feat/ort_io_binding
[A] add io_binding mode for onnxengine with cuda graph on
- Loading branch information
Showing
9 changed files
with
382 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,96 @@ | ||
name: Pull Request | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
branches: [main] | ||
paths-ignore: | ||
- "**/version.h" | ||
- "doc/**" | ||
- "**.md" | ||
|
||
env: | ||
LOCAL_REGISTRY: localhost:5000 | ||
DOCKERFILE: docker/pr.dockerfile | ||
|
||
jobs: | ||
test: | ||
name: Run Tests | ||
get_runner_and_uid: | ||
name: Get Runner | ||
runs-on: [self-hosted, unicorn] | ||
steps: | ||
- name: Get UID and GID | ||
id: uid_gid | ||
run: | | ||
echo "uid_gid=$(id -u):$(id -g)" >> "$GITHUB_OUTPUT" | ||
outputs: | ||
runner: ${{ runner.name }} | ||
uid: ${{ steps.uid_gid.outputs.uid_gid }} | ||
|
||
build_docker_image: | ||
name: Build Docker Image | ||
needs: [get_runner_and_uid] | ||
runs-on: ${{ needs.get_runner_and_uid.outputs.runner }} | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Docker Image | ||
id: docker_build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: ${{ env.DOCKERFILE }} | ||
no-cache: false | ||
push: true | ||
tags: ${{ env.LOCAL_REGISTRY }}/capybara-container:ci | ||
|
||
outputs: | ||
image: ${{ env.LOCAL_REGISTRY }}/capybara-container:ci | ||
|
||
ci: | ||
name: CI | ||
needs: [get_runner_and_uid, build_docker_image] | ||
runs-on: ${{ needs.get_runner_and_uid.outputs.runner }} | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
container: | ||
image: ${{ needs.build_docker_image.outputs.image }} | ||
options: --user ${{ needs.get_runner_and_uid.outputs.uid }} --gpus all | ||
|
||
steps: | ||
- name: Checkout code | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install packages | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install pytest wheel pylint pylint-flask | ||
python setup.py bdist_wheel | ||
wheel_file=$(echo dist/*.whl) | ||
python -m pip install ${wheel_file} --force-reinstall | ||
python3 -m pip install pytest wheel pylint pylint-flask pytest-cov typeguard | ||
- name: Lint with pylint | ||
- name: Build and Install Package | ||
run: | | ||
python -m pylint ${{ github.workspace }}/capybara \ | ||
--rcfile=.github/workflows/.pylintrc \ | ||
--load-plugins pylint_flask \ | ||
python3 setup.py bdist_wheel && \ | ||
wheel_file=$(ls dist/*.whl 2>/dev/null || echo '') && \ | ||
if [ -z "$wheel_file" ]; then | ||
echo 'Error: No wheel file found in dist directory.' && exit 1 | ||
fi && \ | ||
python3 -m pip install $wheel_file --force-reinstall | ||
- name: Test with pytest | ||
- name: Lint with Pylint | ||
run: | | ||
python -m pip install pytest pytest-cov typeguard | ||
python3 -m pylint capybara \ | ||
--rcfile=.github/workflows/.pylintrc \ | ||
--load-plugins pylint_flask | ||
# Test all | ||
python -m pytest tests | ||
# Report all | ||
mkdir -p tests/coverage | ||
python -m pytest -x \ | ||
--junitxml=tests/coverage/cov-jumitxml.xml \ | ||
--cov=capybara tests | tee tests/coverage/cov.txt | ||
- name: Run Tests with Pytest | ||
run: | | ||
mkdir -p tests/coverage && \ | ||
python3 -m pytest tests --junitxml=tests/coverage/cov-junitxml.xml \ | ||
--cov=capybara | tee tests/coverage/cov.txt | ||
- name: Pytest coverage comment | ||
- name: Pytest Coverage Comment | ||
id: coverageComment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
pytest-coverage-path: tests/coverage/cov.txt | ||
junitxml-path: tests/coverage/cov-jumitxml.xml | ||
junitxml-path: tests/coverage/cov-junitxml.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.