beam icon indicating copy to clipboard operation
beam copied to clipboard

TensorRT Initial commit

Open azhurkevich opened this issue 3 years ago • 12 comments
trafficstars

Please add a meaningful description for your change here Integration of TensorRT into Apache Beam.

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • [x] Choose reviewer(s) and mention them in a comment (R: @tvalentyn @AnandInguva @ryanthompson591 @yeandy).
  • [ ] Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • [ ] Update CHANGES.md with noteworthy changes.
  • [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels Python tests Java tests

See CI.md for more information about GitHub Actions CI.

azhurkevich avatar Jul 01 '22 21:07 azhurkevich

Codecov Report

Merging #22131 (2c417db) into master (48513ad) will decrease coverage by 0.19%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #22131      +/-   ##
==========================================
- Coverage   74.18%   73.99%   -0.20%     
==========================================
  Files         706      714       +8     
  Lines       93229    93945     +716     
==========================================
+ Hits        69159    69510     +351     
- Misses      22802    23167     +365     
  Partials     1268     1268              
Flag Coverage Δ
python 83.18% <0.00%> (-0.38%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...am/examples/inference/tensorrt_object_detection.py 0.00% <0.00%> (ø)
...hon/apache_beam/ml/inference/tensorrt_inference.py 0.00% <0.00%> (ø)
sdks/python/apache_beam/typehints/__init__.py 77.77% <0.00%> (-22.23%) :arrow_down:
...ks/python/apache_beam/runners/worker/statecache.py 89.69% <0.00%> (-6.47%) :arrow_down:
.../python/apache_beam/testing/test_stream_service.py 88.09% <0.00%> (-4.77%) :arrow_down:
...dks/python/apache_beam/metrics/monitoring_infos.py 92.50% <0.00%> (-4.50%) :arrow_down:
...examples/inference/sklearn_mnist_classification.py 43.75% <0.00%> (-3.75%) :arrow_down:
sdks/python/apache_beam/internal/pickler.py 92.00% <0.00%> (-3.46%) :arrow_down:
...python/apache_beam/runners/worker/worker_status.py 76.66% <0.00%> (-3.05%) :arrow_down:
sdks/python/apache_beam/utils/interactive_utils.py 95.12% <0.00%> (-2.44%) :arrow_down:
... and 51 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Jul 01 '22 22:07 codecov[bot]

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @ryanthompson591 for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

github-actions[bot] avatar Jul 01 '22 22:07 github-actions[bot]

R: @yeandy @AnandInguva @tvalentyn

yeandy avatar Jul 08 '22 17:07 yeandy

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

github-actions[bot] avatar Jul 08 '22 17:07 github-actions[bot]

@yeandy I think this will be it for the first initial TensorRT integration from my side. Moving multi-input models into future integration.

azhurkevich avatar Jul 18 '22 20:07 azhurkevich

Sounds good, thanks!

yeandy avatar Jul 18 '22 20:07 yeandy

@yeandy I'll look into what you've mentioned tomorrow, will try to address the issues as soon as I figure them out.

azhurkevich avatar Jul 18 '22 20:07 azhurkevich

Actually, I have been experimenting around with the docs stuff in your branch. I can do a quick fix right now.

yeandy avatar Jul 18 '22 20:07 yeandy

The Sphinx docs generation requires module imports import tensorrt as trt and from cuda import cuda. I think our script just needs to detect that those modules exist in tensorrt_inference.py via the import statements. @azhurkevich Want to confirm before I pursue a different route: To your knowledge, is there a way to install these two packages without having GPUs, drivers, toolkit, etc. set up? (I was trying pip installation method locally, but ran into issues)

yeandy avatar Jul 19 '22 16:07 yeandy

@yeandy With Sphinx, you can specify modules to mock in your conf.py (example). With that, you won't need to have TensorRT installed.

pranavm-nvidia avatar Jul 19 '22 16:07 pranavm-nvidia

Oh, great to know! Thanks @pranavm-nvidia, I'll check that out

yeandy avatar Jul 19 '22 17:07 yeandy

Just a heads-up, Andy is OOO atm, so his responses may be delayed till next week.

tvalentyn avatar Jul 26 '22 21:07 tvalentyn

Run PythonLint PreCommit

tvalentyn avatar Aug 22 '22 15:08 tvalentyn

@ryanthompson591 My bad, forgot about implementation. Pushed now, thanks!

azhurkevich avatar Aug 30 '22 18:08 azhurkevich

Run Python 3.8 PostCommit

AnandInguva avatar Sep 07 '22 22:09 AnandInguva

Run Python 3.8 PostCommit

yeandy avatar Sep 08 '22 12:09 yeandy

I took a closer look, see suggestions. I haven't tested it.

Pushed the suggestions, let's see if the tests pass.

tvalentyn avatar Sep 14 '22 21:09 tvalentyn

Run Python 3.8 PostCommit

AnandInguva avatar Sep 14 '22 21:09 AnandInguva

Run Python PreCommit

damccorm avatar Sep 16 '22 13:09 damccorm

Run Python PreCommit

damccorm avatar Sep 16 '22 15:09 damccorm

Good job everyone, and thanks @damccorm for the merge!

yeandy avatar Sep 16 '22 17:09 yeandy