NVIDIA-Merlin / models

Merlin Models is a collection of deep learning recommender system model reference implementations
https://nvidia-merlin.github.io/models/main/index.html
Apache License 2.0
262 stars 50 forks source link

[BUG] Unable to serve a session-based topk_model on Triton due to TypeError: Unable to serialize item_id-list to JSON. Unrecognized type <class 'merlin.schema.schema.ColumnSchema'>. #1212

Closed rnyak closed 1 year ago

rnyak commented 1 year ago

Bug description

I created this bug ticket on systems and cross linking it here.

The issue might be solved from Merlin models side, not from Systems side.

The main reason for this bug is that the topk model cannot be saved properly. we get an error like below:

...
File /usr/lib/python3.8/json/encoder.py:257, in JSONEncoder.iterencode(self, o, _one_shot)
    252 else:
    253     _iterencode = _make_iterencode(
    254         markers, self.default, _encoder, self.indent, floatstr,
    255         self.key_separator, self.item_separator, self.sort_keys,
    256         self.skipkeys, _one_shot)
--> 257 return _iterencode(o, 0)

TypeError: Unable to serialize item_id-list to JSON. Unrecognized type <class 'merlin.schema.schema.ColumnSchema'>.

Steps/Code to reproduce bug

Please run the code in this gist to repro the issue.

Expected behavior

We should be able to serve a session-based topk_model on Triton and be able to return topK scores and corresponding item-ids

Environment details