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

feat: Upgrade Docker build to use custom TRT + CUDNN #1805

Merged
merged 4 commits into from
Apr 13, 2023

Conversation

gs-olive
Copy link
Collaborator

@gs-olive gs-olive commented Apr 4, 2023

Description

  • Upgrade Ubuntu version to 22.04
  • Make custom build args for TensorRT and CUDNN versions, user-specifiable in a.b.c version format
  • Make build args required, without defaults, to improve code cleanliness and reduce amount of changes needed when versions shift
  • Provide clear error messages when the build args are not provided by the user
  • Add documentation of the change in the Docker README

Fixes #1782

Type of change

Please delete options that are not relevant and/or add your own.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • [ x ] My code follows the style guidelines of this project (You can use the linters)
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ x ] I have made corresponding changes to the documentation
  • [ - ] I have added tests to verify my fix or my feature
    • Build tested locally
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified

- Upgrade Ubuntu version to 22.04
- Make custom build args for TensorRT and CUDNN versions,
user-specifiable in a.b.c version format
- Make build args required, without defaults, to improve code
cleanliness and reduce amount of changes needed when versions shift
- Provide clear error messages when the build args are not provided by
the user
- Add documentation of the change in the Docker README
@gs-olive gs-olive added WIP Work is in progress, pull request should not be merged yet and removed WIP Work is in progress, pull request should not be merged yet labels Apr 6, 2023

FROM torch-tensorrt-builder-base as torch-tensorrt-builder

COPY . /workspace/torch_tensorrt/src
WORKDIR /workspace/torch_tensorrt/src
RUN cp ./docker/WORKSPACE.docker WORKSPACE

# Symlink the path pyenv is using for python with the /usr/local/lib/ for package sourcing
RUN ln -s "`pyenv which python | xargs dirname | xargs dirname`/lib/python$PYTHON_VERSION/site-packages" "/usr/local/lib/python"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since pyenv puts the packages for the distribution in a different location, create a symbolic link to an unchanging path, which is then used in the WORKSPACE files to source libtorch.

@gs-olive gs-olive force-pushed the docker_improvements branch 2 times, most recently from bea8814 to 7b1707b Compare April 10, 2023 23:40
- Add support for pyenv in Docker file, allowing specification of a
custom Python version
- Update WORKSPACE files to automatically synchronize regardless of
Python version choice, using symbolic links
- Update dependencies accordingly
- Add documentation for changing the base image of the Docker container
Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

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

LGTM

- Add documentation regarding Python versioning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨[Feature] Upgrade Docker to Ubuntu 22.04 + Add build-args for TensorRT + cuDNN versions
3 participants