tensorflow / tensorflow/probability

Importing substrates is slow

Open
#1,714 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

It takes a noticeably long time to just import TFP substrates:

$ time python3 -c "import tensorflow_probability.substrates.jax"
python3 -c "import tensorflow_probability.substrates.jax"  4.72s user 0.77s system 116% cpu 4.724 total

$ time python3 -c "import tensorflow_probability.substrates.numpy"
python3 -c "import tensorflow_probability.substrates.numpy"  4.75s user 0.86s system 115% cpu 4.843 total

Might it be possible to speed up these imports somehow?

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 by reproducing the timings for importing tensorflow_probability.substrates.jax and tensorflow_probability.substrates.numpy with the shown Python commands. Trace those substrate import entry points to identify the startup cost; done means demonstrating that both imports are measurably faster without breaking their import behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.