NVIDIA-Merlin / Merlin

NVIDIA Merlin is an open source library providing end-to-end GPU-accelerated recommender systems, from feature engineering and preprocessing to training deep learning models and running inference in production.
Apache License 2.0
758 stars 113 forks source link

[QST] 2-stage ensemble throwing 'extra columns' error #862

Open Tselmeg-C opened 1 year ago

Tselmeg-C commented 1 year ago

❓ Questions & Help

Details

I am trying to simply create a 2-stage ensemble using System and TIS. I first used NV Tabular to transform my data and trained a DLRM on it and tried to serve workflow + ranking ensemble using TIS, but it was giving me an error saying there are two extra columns (userID and itemID) and won't allow me to do inference, what have I done wrong ?

The transform workflow is defined as in the image. I did not 'categorify' user_id and item_id, because those were tokenized beforehand and I just want to use the original tokens as features and avoid an extra mapping step in the end (as long as I understand right, the categorify is not equal to 'tokenize', instead it is doing some kind of 'binning' operation on the features, right?) image the schema looks like this: image Model info looks like this: image

karlhigley commented 1 year ago

This validation error was added to signal that the workflow is producing more columns than the model is consuming, which historically was a problem due to how picky Triton ensembles are about making sure that every column that's produced is also used. However, we've made some changes under the hood to avoid that issue, so the validation error is no longer needed and we're removing it. That change should be included in the next Merlin release, but in the mean time you can remove unused columns from the workflow's output either by subtracting a list of the column names that aren't used from the end of the outputs = item_id + user_id + ... line or by not including them on that line (if possible.)

Tselmeg-C commented 1 year ago

@karlhigley Thanks for your answer. But I am confused at this point, I do want to use item_id and user_id as model input features (I think I am using them to do 'collaborative filtering' if I use them as features). I just don't want to 'categorify' them, because I think 'categorify' is doing some 'binning' operation under the hood and needs to be mapped back to the original IDs, to save this step I just use them directly as features without transforming them through 'categorify' opt. They are specified as input features (they were in the Schema) of dlrm, at least I think that was what I was doing. So, why the error, what I did wrong?