Skip to content

How to pass parameter in ensemble model? #71

Closed

Description

@GooVincent

As the normal procedure for tensorrtllm_backend is preprocessing -> (tensorrt_llm) process -> postprocessing. How to pass the customer parameter from the request, like request token length.

In my understanding, tensorrt_llm backend will finish the infer, it won't work to add input and output parameter. then the issue coming, in ensemble pipeline, how to pass the parameter from the preprocess module to poseprocess module.

Please any way to solve this issue?

Activity

  1. byshiue commented on Nov 1, 2023

    @byshiue
    Contributor

    I think I don't really get your question. max_tokens (here) is a input form parameter, which is similar to request token length. Can you explain more for your question?

  2. self-assigned this
    on Nov 1, 2023
  3. GooVincent commented on Nov 2, 2023

    @GooVincent
    Author

    Well, I understood how to pass the parameter from the model preprocess to model tensorrt_llm, like REQUEST_INPUT_LEN
    image

    but how to pass REQUEST_INPUT_LEN from model tensorrt_llm to the model postprocess, I get confused, as the output for tensorrt_llm should be fixed based the llm model. correct?

  4. byshiue commented on Nov 2, 2023

    @byshiue
    Contributor

    For ensemble, you should pass REQUEST_INPUT_LEN for ensemble to postprocess, instead of passing from tensorrt_llm to postprocess.

  5. GooVincent commented on Nov 2, 2023

    @GooVincent
    Author

    Any guide for this please? as the REQUEST_INPUT_LEN is the intermediate result.

  6. byshiue commented on Nov 2, 2023

    @byshiue
    Contributor

    I get your point. As far as I know, there is no way to support such feature in tensorrt_llm backend directly because it needs to change the source code of batch_manager. You can try to map the output of preporcess to input of postprocess directly. I am not sure is it doable. You can ask in tritonserver repo.

  7. GooVincent commented on Nov 2, 2023

    @GooVincent
    Author

    okay, thanks.

  8. GooVincent commented on Nov 2, 2023

    @GooVincent
    Author

    I get your point. As far as I know, there is no way to support such feature in tensorrt_llm backend directly because it needs to change the source code of batch_manager. You can try to map the output of preporcess to input of postprocess directly. I am not sure is it doable. You can ask in tritonserver repo.

    Any way for the ensemble mode to know the request token length, as I wanna cut the original tokens.

  9. BasicCoder commented on Nov 3, 2023

    @BasicCoder

    I get your point. As far as I know, there is no way to support such feature in tensorrt_llm backend directly because it needs to change the source code of batch_manager. You can try to map the output of preporcess to input of postprocess directly. I am not sure is it doable. You can ask in tritonserver repo.

    Any way for the ensemble mode to know the request token length, as I wanna cut the original tokens.

    May be you can reference this #95

  10. callmezhangchenchenokay commented on Nov 8, 2023

    @callmezhangchenchenokay

    @GooVincent Hi ,
    Have you solved it yet

  11. callmezhangchenchenokay commented on Dec 8, 2023

    @callmezhangchenchenokay
  12. byshiue commented on Dec 11, 2023

    @byshiue
    Contributor

    Since the issue is solved, close this bug. If you still have issue/question, feel free to ask and we will open the issue again.

  13. callmezhangchenchenokay commented on Dec 29, 2023

    @callmezhangchenchenokay

    Sorry to interrupt again!

    The solution mentioned above requires model_transaction_policy to be set to True,
    Can only be used if stream = False,

    However, this problem occurs when stream = True
    image

    So there needs to be a way to export REQUEST_INPUT_LEN from stream =True, model_transaction_policy =True

  14. byshiue commented on Jan 3, 2024

    @byshiue
    Contributor

    I don't get you point of "set model_transaction_policy to be True". model_transaction_policy is a set of policy and stream (decoupled mode) is one of them.

  15. callmezhangchenchenokay commented on Jan 4, 2024

    @callmezhangchenchenokay

    Excuse me! It's my expression
    What I'm trying to say is,

    ‘’‘
    model_transaction_policy {
    decoupled: true
    }
    ’‘’
    (decoupled) If set to False, can export REQUEST_INPUT_LEN,
    However, when decoupled is set to True, the following error is reported

    293334648-a216f237-b0f6-4217-a849-96040316f794
  16. byshiue commented on Jan 8, 2024

    @byshiue
    Contributor

    Excuse me! It's my expression What I'm trying to say is,

    ‘’‘ model_transaction_policy { decoupled: true } ’‘’ (decoupled) If set to False, can export REQUEST_INPUT_LEN, However, when decoupled is set to True, the following error is reported

    293334648-a216f237-b0f6-4217-a849-96040316f794

    Could you try scripts here https://github.com/triton-inference-server/tensorrtllm_backend/blob/main/docs/llama.md#end-to-end-workflow-to-run-llama to run the streamming?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions