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

Handle ColumnSchema target in serialization of SequenceTransform #1214

Conversation

oliverholworthy
Copy link
Member

Fixes #1212

Goals ⚽

Enable serialization of SequenceTransform layers. with schema target.

Implementation Details 🚧

Handle ColumnSchema target in serialization of SequenceTransform

Testing Details πŸ”

@oliverholworthy oliverholworthy added the bug Something isn't working label Oct 4, 2023
@oliverholworthy oliverholworthy self-assigned this Oct 4, 2023
@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Documentation preview

https://nvidia-merlin.github.io/models/review/pr-1214

@oliverholworthy
Copy link
Member Author

While this change will enable saving a model with SequenceTransform layers with a target type of ColumnSchema.

The example code linked in the related bug issue, shows that the SequenceMaskLast layer is only used as part of the pre of the .evaluate call. This layer then fails to serialize when calling .save() on the model, because keras finds a ColumnSchema object which it doesn't know what to do with.

We should check if it's intended that the call to evaluate has a side-effect of adding this SequenceMaskLast layer to the model. Since if the SequenceTransform layers are only used in the pre, and don't become part of the model, in that usecase, they may not strictly need to be saved/serialized to json correctly.

@rnyak
Copy link
Contributor

rnyak commented Oct 4, 2023

@gabrielspmoreira @sararb fyi.

@rnyak
Copy link
Contributor

rnyak commented Oct 12, 2023

@gabrielspmoreira and @oliverholworthy I tested this fix and now we can serve topk_model on Triton, however served topK_model returns only top 100 scores which does not make sense without item ids. we might need to fix the pertinent code so that it returns both the scores and corresponding item_ids. I assume for that we need exported schema to show to outputs (scores and ids) ?

@rnyak rnyak requested a review from sararb October 17, 2023 13:10
@rnyak rnyak self-requested a review October 31, 2023 14:08
@rnyak rnyak merged commit 16d289a into NVIDIA-Merlin:main Nov 2, 2023
40 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants