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

Python Client API support for shared memory #570

Merged
merged 26 commits into from
Aug 29, 2019

Conversation

CoderHam
Copy link
Contributor

@CoderHam CoderHam commented Aug 20, 2019

Adds support for using the shared memory functionality via the Python client API

@CoderHam CoderHam force-pushed the hemantj-sharedMemory-python branch 6 times, most recently from 9a4f7ba to 9b909f6 Compare August 23, 2019 01:22
src/clients/c++/simple_shm_client.cc Outdated Show resolved Hide resolved
src/clients/python/CMakeLists.txt Outdated Show resolved Hide resolved
src/clients/python/CMakeLists.txt Outdated Show resolved Hide resolved
src/clients/python/CMakeLists.txt Outdated Show resolved Hide resolved
else
cp Release/crequest.dll \
"${WHLDIR}/tensorrtserver/api/."
cp ../c++/Release/request.dll \
"${WHLDIR}/tensorrtserver/api/."
cp Release/cshmwrap.dll \
Copy link
Contributor

Choose a reason for hiding this comment

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

Shared memory won't work on Windows (at least not with the api you are using). Need to have functions return error on windows platform

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

src/clients/python/__init__.py Outdated Show resolved Hide resolved
src/clients/python/__init__.py Outdated Show resolved Hide resolved
src/clients/python/__init__.py Outdated Show resolved Hide resolved
src/clients/python/__init__.py Outdated Show resolved Hide resolved
src/clients/python/simple_shm_client.py Outdated Show resolved Hide resolved
@CoderHam CoderHam force-pushed the hemantj-sharedMemory-python branch 3 times, most recently from 5a61f1a to 4073d99 Compare August 27, 2019 18:53
@CoderHam CoderHam force-pushed the hemantj-sharedMemory-python branch 2 times, most recently from 1105401 to 586aada Compare August 28, 2019 19:09
src/clients/python/shared_memory/__init__.py Outdated Show resolved Hide resolved
src/clients/python/crequest.cc Show resolved Hide resolved
src/clients/python/crequest.h Show resolved Hide resolved
src/clients/python/shared_memory/__init__.py Outdated Show resolved Hide resolved
src/clients/python/shared_memory/__init__.py Outdated Show resolved Hide resolved
src/clients/python/simple_shm_client.py Outdated Show resolved Hide resolved
src/clients/python/simple_shm_client.py Outdated Show resolved Hide resolved
@CoderHam CoderHam force-pushed the hemantj-sharedMemory-python branch 2 times, most recently from 1d7ad0a to 4fc0e35 Compare August 29, 2019 02:15
src/clients/python/shared_memory/__init__.py Outdated Show resolved Hide resolved
src/clients/python/shared_memory/__init__.py Outdated Show resolved Hide resolved
src/clients/python/shared_memory/shared_memory.h Outdated Show resolved Hide resolved
src/clients/python/__init__.py Outdated Show resolved Hide resolved
src/clients/python/__init__.py Outdated Show resolved Hide resolved
src/clients/python/__init__.py Outdated Show resolved Hide resolved
src/clients/python/__init__.py Outdated Show resolved Hide resolved
@@ -832,51 +988,61 @@ def _prepare_request(self, inputs, outputs,
c_void_p(_crequest_infer_ctx_input_new(byref(input), self._ctx, input_name)))

# Set the input shape
if len(input_values) > 0:
shape_value = np.asarray(input_values[0].shape, dtype=np.int64)
if isinstance(input_values, (list, tuple)):
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused about how you've changed this logic... we can discuss.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the input_values can be a list/tuple of np.arrays or a single c_void_p representing the input data values in shared memory, this check is needed. We should only get the shape from the input data if input_values is a list i.e. does not use shared memory.

@deadeyegoodwin deadeyegoodwin merged commit 3bb6ca9 into master Aug 29, 2019
@deadeyegoodwin deadeyegoodwin deleted the hemantj-sharedMemory-python branch August 29, 2019 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants