tensorflow / tensorflow/recommenders

Saving Large ScaNN Retrieval Model - memory bottleneck

Open
#528 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
300
PR merge metrics
No merged PRs in 30d

Description

I have a large retrieval model that uses the ScaNN method for indexing the recommendations.

I'm saving the model out for the retrieval speed increase.

I'm starting to run models with +5M records, and I can't save the model to disk without my system memory crashing.

I've looked into pruning the model and saving the weights. Will this work with the ScaNN index?

Can anyone suggest how to get around the memory bottleneck when saving a large ScaNN retrieval model?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue mentions a large TensorFlow Recommenders model using ScaNN and more than 5 million records, but names no files, tests, or entry points. Start by reproducing the save operation with a similarly sized model and measuring memory during serialization. Done would require an agreed, reproducible fix or documented workaround for saving without exhausting system memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
10/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.