Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nvcr.io/nvidia/tensorrt image for GPU tests #660

Merged
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
11 changes: 7 additions & 4 deletions .github/workflows/test_onnxruntime_gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: ONNX Runtime / Test GPU

on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: 0 7 * * * # every day at 7am
pull_request:
types: [labeled]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be any label right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I added it so that the test can be triggered on a PR. I don't know if we can specify a specific tag, do you know?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@regisss Unfortunately external PRs can not access secrets from huggingface/optimum it seems, so this was not very useful: https://github.com/huggingface/optimum/actions/runs/3845671285/jobs/6550087462

# uncomment to enable on PR merge on main branch:
#push:
# branches:
# - main

jobs:
start-runner:
Expand Down Expand Up @@ -59,7 +62,7 @@ jobs:
docker build -f tests/onnxruntime/Dockerfile_onnxruntime_gpu -t onnxruntime-gpu .
- name: Test with unittest within docker container
run: |
docker run --gpus all --workdir=/workspace/optimum/tests onnxruntime-gpu:latest
docker run --rm --gpus all --workdir=/workspace/optimum/tests onnxruntime-gpu:latest

stop-runner:
name: Stop self-hosted EC2 runner
Expand Down
21 changes: 4 additions & 17 deletions tests/onnxruntime/Dockerfile_onnxruntime_gpu
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# Use nvidia/cuda image
FROM nvidia/cuda:11.6.2-cudnn8-devel-ubuntu20.04
# use version with cudnn 8.5 to match torch==1.13.1 that uses 8.5.0.96
# has Python 3.8.10
FROM nvcr.io/nvidia/tensorrt:22.08-py3
CMD nvidia-smi

# Ignore interactive questions during `docker build`
ENV DEBIAN_FRONTEND noninteractive

# Bash shell
RUN chsh -s /bin/bash
SHELL ["/bin/bash", "-c"]

# Temporary fix until NVDIA finish the update of its docker images
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils

# Install and update tools to minimize security vulnerabilities
RUN apt-get update
RUN apt-get install -y software-properties-common wget apt-utils patchelf git libprotobuf-dev protobuf-compiler cmake \
Expand All @@ -21,13 +14,7 @@ RUN apt-get install -y software-properties-common wget apt-utils patchelf git li
RUN unattended-upgrade
RUN apt-get autoremove -y

# Install Pythyon (3.8 as default)
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN apt-get install -y python3-pip
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
RUN pip install -U pip
RUN pip install pygit2 pgzip
RUN pip3 install --upgrade requests
RUN python -m pip install -U pip

# Install Optimum
COPY . /workspace/optimum
Expand Down