Skip to content

Implicit state management #103

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

Merged
merged 5 commits into from
Jul 7, 2023

Conversation

jamied157
Copy link
Contributor

Addresses triton-inference-server/server#5609

I tried to copy the onnxruntime backend as much as possible. To work with how PyTorch treats input and output names, I've tried to only allow the "INPUT__X/OUTPUT__X" naming convention when a state field is defined.

@Tabrizian
Copy link
Member

Really appreciate your contribution to the Triton project! Could you please sign the CLA as instructed here?

@Tabrizian Tabrizian self-assigned this Apr 27, 2023
@jamied157
Copy link
Contributor Author

Sorry for the delay on this, that should be sent over now

@jamied157
Copy link
Contributor Author

Just wanted to bump this again, have you received the CLA? I'm aware I need to add some tests from the qa folder in the main server repo, could you point me to the ones I should be looking at?

@Tabrizian
Copy link
Member

Hi @jamied157, I can confirm that we've received the CLA. You need to libtorch to the list of BACKENDS here. Also, you need to add model generation scripts for the models https://github.com/triton-inference-server/server/blob/main/qa/common/gen_qa_implicit_models.py

It might be a bit difficult to get started with testing infra. Feel free to give it a shot and if you run into issues I can take care of testing.

@jamied157
Copy link
Contributor Author

Hi again, I haven't been able to have a look at the tests yet (and it might take me a while), so feel free to get started if you can. Otherwise I'll take a look when I've got the time.

Copy link
Member

@Tabrizian Tabrizian left a comment

Choose a reason for hiding this comment

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

The PR mostly looks good. We probably need to add some testing around different naming conventions too to make sure it is working properly.

src/libtorch.cc Outdated
@@ -35,6 +36,7 @@
#include "triton/backend/backend_output_responder.h"
#include "triton/common/nvtx.h"
#include "triton/core/tritonbackend.h"
#include "triton/core/tritonserver.h"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this import is required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is removed

// can have intersection with the outputs section of the model. If an output
// is specified both in the output section and state section, it indicates
// that the backend must return the output state to the client too.
std::map<std::string, std::pair<int64_t, int64_t>> model_outputs_;
Copy link
Member

Choose a reason for hiding this comment

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

Can you mention in the comment that the first pair is the model output index and second pair is the state index. -1 will be used if either of them are not required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

src/libtorch.cc Outdated
input_index_map_[io_name] =
std::distance(allowed_inputs.begin(), itr);
}
return;
Copy link
Member

Choose a reason for hiding this comment

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

I think you should return error on the else condition that input is not valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

src/libtorch.cc Outdated
.c_str());
}


Copy link
Member

Choose a reason for hiding this comment

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

Remove extra line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is gone

src/libtorch.cc Outdated
@@ -25,6 +25,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <stdint.h>
#include <cstdint>
Copy link
Member

Choose a reason for hiding this comment

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

Where is this import needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is gone

@jamied157
Copy link
Contributor Author

Thanks for continuing to work on this!

@Tabrizian Tabrizian merged commit 00b38a9 into triton-inference-server:main Jul 7, 2023
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.

4 participants