tensorflow / tensorflow/model-optimization

Move TFMOT Library Code Off Private APIs

Open
#305 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

technique:all
Dominant language
Python
Stars
1.6k
Forks
349
Avg merge
3d 2h
Merged PRs (30d)
1

Description

TFMOT currently has dependencies on TF and tf.keras private APIs. This is a focused effort to completely move off of them. We don't want TFMOT releases to stop working with newer TF releases.

Most recently, tfmot.sparsity.keras.PruningSummaries has stopped working with tf-nightly because of a dependence on a private _log_metrics API. If we can move this to use the previously available tf.summary public API, then our next release will work with all > 1.14.0 releases.

If we don't address this now, it'll eventually start to slow down releases as we may want to delay them to ensure all the techniques work with the next TF release(s).

For pruning and quantization, I've previously removed all (or nearly all) private APIs we use that we know how to fix without guidance from TF / tf.keras. Below, I'll put together a list of the ones that remain in order of priority and tackle them one-by-one.

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

Start with tfmot.sparsity.keras.PruningSummaries and trace its use of the private _log_metrics API. Compare that path with the available tf.summary public API, then identify the remaining private TensorFlow and tf.keras dependencies described in the issue. Done means the affected paths no longer depend on private APIs and continue working across the stated TensorFlow releases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.