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

notes on: triton model adapter in prediction pipeline #4

Open
FynnBe opened this issue Jun 17, 2022 · 5 comments
Open

notes on: triton model adapter in prediction pipeline #4

FynnBe opened this issue Jun 17, 2022 · 5 comments

Comments

@FynnBe
Copy link
Member

FynnBe commented Jun 17, 2022

In order to implement a create_prediction_pipeline (for a triton model adapter) that takes in a RAW model description I had a look at the current use case:

model_resource = bioimageio.core.load_raw_resource_description(
model_id
)
pred_pipeline = create_prediction_pipeline(
bioimageio_model=model_resource,
model_adapter=TritonModelAdapter(
server_url="127.0.0.1:8000",
model_id=model_id,
model_version="1",
model_resource=model_resource,
),
)

What strikes me as odd here is the parallel use of model_id and model_resource.

As discussed "offline" with @k-dominik it might make sense to separate a create_server_prediction_pipeline from the create_prediction_pipeline due to the different requirements and use-cases. It is important to keep the prediction pipeline interface the same across model adapters, but a separate creation function shouldn't wreak too much havoc...

I'll take a close look and make a PR soon

cc @oeway

@oeway
Copy link
Contributor

oeway commented Jun 17, 2022

What strikes me as odd here is the parallel use of model_id and model_resource.

Not sure what you mean, odd, but the model_id passed in TritonModelAdapter is the id used in the triton server, which can be different but in this particular case they are the same (think nickname vs zenodo id).

It seems not necessary to make a separate function, we just need to get the raw resource description work. Later we can make another model adapter which talks to a remote server to do inference too, it's all fits in the definition of prediction pipeline.

@FynnBe
Copy link
Member Author

FynnBe commented Jun 17, 2022

odd because the model_resource contains all information about the model.. why would we want to use a different id in triton?
Anyway, that is not the main problem at hand...

@oeway
Copy link
Contributor

oeway commented Jun 17, 2022

Well, not really, the model resource is not aware of the triton server, so we cannot know the triton model id from the model resource.

@FynnBe
Copy link
Member Author

FynnBe commented Jun 17, 2022

but the triton server is certainly aware of the model zoo? so why not reuse the model id?

@oeway
Copy link
Contributor

oeway commented Jun 17, 2022

We are using that, but there are more complications with different model versions. I'd rather pass it again so I can easily rewrite it to match different strategy we may come up with.

And I am not sure it worth a lot of discussion on the function signature of an internal class too. It's not working yet, we can always change later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants