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

[QST] How to deploy model using Pretrain Embeddings with EmbeddingOperator in Triton #1241

Open
jhnealand opened this issue Jun 4, 2024 · 1 comment

Comments

@jhnealand
Copy link

❓ Questions & Help

Details

I have trained both a Two Tower and DLRM model using PreTrained embeddings using a Loader with EmbeddingOperator following the approach from this example:

https://github.com/NVIDIA-Merlin/models/blob/main/examples/usecases/entertainment-with-pretrained-embeddings.ipynb

My models train, and I would now like to deploy them to a Triton ensemble.

Here is the Loader I used with the EmbeddingOperator to look up the pretrained embeddings.

train_loader = mm.Loader(
    train,
    batch_size=1024,
    transforms=[
        EmbeddingOperator(
            item_embedding_array,
            lookup_key="liked",
            embedding_name="liked",
        )
    ],
)

Prior to using PreTrained Embeddings, my workflow to deploy the model looked like this:

workflow =  nvt.Workflow(['item_id'] +(['liked', .... some other informants ], 
                                       >> TransformWorkflow(retrieval_item_workflow)                                     
                                       >> PredictTensorflow(retrieval_model.candidate_encoder)))

I think I need to add a step in this workflow that looks up the pre-trained embeddings for the "liked" column. I've tried inserting an EmbeddingOperator step in the workflow directly:

workflow =  nvt.Workflow(['item_id'] +(informant_columns, 
                                       >> TransformWorkflow(retrieval_item_workflow)                                   
                                       >> EmbeddingOperator( item_embedding_array,
                                                                                lookup_key="liked",
                                                                                embedding_name="liked")
                                       >> PredictTensorflow(retrieval_model.candidate_encoder)))

I've also tried putting the EmbeddingOperator as part of my NVTabular workflow (ie. retrieval_item_workflow).

What is the correct way to deply a model that has been trained with an EmbeddingOperator transform in the Loader?

@CarloNicolini
Copy link

Maybe you can check at the documentation or examples of Merlin Systems for this?

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

No branches or pull requests

2 participants