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

chore: Expose TRITONSERVER_Server instance in Python In-Process API #385

Merged
merged 32 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
82c58cf
Exposing C pointer to TRITONSERVER_Server object
KrishnanPrash Jul 12, 2024
5d54ccd
Breaking down pointer
KrishnanPrash Jul 13, 2024
69236cc
fixing casting logic
KrishnanPrash Jul 13, 2024
0370f8e
Making data types consistent
KrishnanPrash Jul 13, 2024
817aaf4
Adding missing paranthesis
KrishnanPrash Jul 13, 2024
32e1c2c
Adding API Support for C Pointer
KrishnanPrash Jul 13, 2024
2538330
Fixing Function Name
KrishnanPrash Jul 15, 2024
629c349
Adding print statements
KrishnanPrash Jul 15, 2024
50c79c7
Testing
KrishnanPrash Jul 16, 2024
312d8eb
Pushing an error on purpose
KrishnanPrash Jul 16, 2024
06fb462
Undoing the error
KrishnanPrash Jul 16, 2024
09e3d74
Cleaning up
KrishnanPrash Aug 3, 2024
e1dfd77
remove extra print
KrishnanPrash Aug 3, 2024
f75f566
Format w pre-commit
KrishnanPrash Aug 5, 2024
3bdad40
Removing extra lines and print statements
KrishnanPrash Aug 5, 2024
e1b940b
Spacing
KrishnanPrash Aug 5, 2024
5350d2c
Change function name
KrishnanPrash Aug 16, 2024
8de60f1
New function name for binding
KrishnanPrash Aug 16, 2024
c71bbd2
Changing tritonserver api function name
KrishnanPrash Aug 16, 2024
dd10a84
Changing binding func name
KrishnanPrash Aug 16, 2024
f7067f5
resolving merge conflict
KrishnanPrash Aug 18, 2024
74f3d99
Merge branch 'main' into kprashanth-pybind
KrishnanPrash Aug 29, 2024
16828a5
Update .gitignore
KrishnanPrash Aug 29, 2024
ad4620f
Use inherited Ptr
KrishnanPrash Aug 29, 2024
042eee7
removing extra function
KrishnanPrash Aug 29, 2024
07d6385
reverting to prev flow
KrishnanPrash Aug 29, 2024
a950a30
Using lambda
KrishnanPrash Aug 29, 2024
9186805
Remove extra func
KrishnanPrash Aug 29, 2024
86e9557
fixing lambda function
KrishnanPrash Aug 29, 2024
a8dd331
fixing lambda func
KrishnanPrash Aug 29, 2024
e4e3bd2
removing reference
KrishnanPrash Aug 29, 2024
6d55950
adding return
KrishnanPrash Aug 29, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build
/.vscode
*.so
*__pycache__/
KrishnanPrash marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions python/tritonserver/_api/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ def stop(self) -> None:
self._server.stop()
self._server = Server._UnstartedServer()

def _ptr(self):
return self._server._ptr()

def unregister_model_repository(self, repository_path: str) -> None:
"""Unregister model repository

Expand Down
6 changes: 6 additions & 0 deletions python/tritonserver/_c/tritonserver_pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,11 @@ class PyServer : public PyWrapper<struct TRITONSERVER_Server> {
owned_ = true;
}

uintptr_t _ptr()
{ // Calls PyWrapper
return reinterpret_cast<uintptr_t>(this->Ptr());
rmccorm4 marked this conversation as resolved.
Show resolved Hide resolved
}

void Stop() const
{
// ServerStop is blocking for the duration of the server exit timeout, so
Expand Down Expand Up @@ -2107,6 +2112,7 @@ PYBIND11_MODULE(triton_bindings, m)
.export_values();
py::class_<PyServer>(m, "TRITONSERVER_Server")
.def(py::init<PyServerOptions&>())
.def("_ptr", &PyServer::_ptr)
KrishnanPrash marked this conversation as resolved.
Show resolved Hide resolved
.def("stop", &PyServer::Stop)
.def("register_model_repository", &PyServer::RegisterModelRepository)
.def("unregister_model_repository", &PyServer::UnregisterModelRepository)
Expand Down
Loading