Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
TensorRT Initial commit #22131
TensorRT Initial commit #22131
Changes from 1 commit
1109810
dcccde4
b29b9f6
f9517d6
b6b1798
23c14f1
4d507b7
bb099d5
e509716
d2e5694
d61688b
8055026
4b6b133
b7157d4
918bf95
ff83c38
382b885
a79e91f
6b94cc4
caea4c2
1b27035
5d52984
93a1d98
ff1433e
bea148f
ec0f276
93eb45f
70fd62f
8ac1d10
4fabc51
700e528
811ee31
72f89a7
59b8784
a9b0417
89eeadd
fbacd43
a994b80
bee8af2
2c417db
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this implementation thread-safe?
Beam SDKs can start multiple concurrent threads within sdk_worker process, which will be processing the data. Are there any concerns with that from hardware or software standpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pranavm-nvidia any comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks thread-safe. It would be good to share the engine between threads so you don't end up duplicating the model weights (maybe that can be future work). Each thread will still need a separate execution context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, leave it for the future. Big thanks @pranavm-nvidia, any tips where I can read more about how to properly implement this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azhurkevich I'm not sure how multi-threading is set up in Beam, but the basic idea would be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like
threading.Lock
should work here? Unless there is a separate API provided by Beam which would be preferred?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tvalentyn any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use threading.RLock, so that the same thread can also aquire it if it somehow becomes necessary, I haven't look very close into where to place this lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tvalentyn Do we have this mechanism that you are mentioning in PyTorch example? It would be easier for me to understand what you would like to see if there is a reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. I took a closer look, see suggestions. I haven't tested it.