tensorflow / tensorflow/tensorboard
Improve plugin asset traversal logic
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
Description
The legacy plugin asset system, for better or for worse, still doesn't have a good replacement. The built-in functionality in EventMultiplexer to retrieve lists of plugin assets is extremely slow (it traverses every single run directory, every time you call it), which has required plugins who depend on this retrieval process to resort to running it asynchronously in order to not block in is_active() or HTTP request processing.
We should rework this logic so it happens as part of the regular Reload() cycle for the EventMultiplexer, on the existing background thread, and the results are cached for quick retrieval.
This way we can stop implementing one-off threaded workarounds for the following plugins:
-
Projector plugin (async for
is_active(), sync for serving path) - see #326
https://github.com/tensorflow/tensorboard/blob/387d52fd2605b59e5f7c17034636ed908f1b4cd4/tensorboard/plugins/projector/projector_plugin.py#L460-L466 -
Text plugin (async for both
is_active()and serving path) - see #663
https://github.com/tensorflow/tensorboard/blob/387d52fd2605b59e5f7c17034636ed908f1b4cd4/tensorboard/plugins/text/text_plugin.py#L285-L298 -
Profile plugin (async for
is_active(); sync for the serving path) - see #1931
https://github.com/tensorflow/tensorboard/blob/387d52fd2605b59e5f7c17034636ed908f1b4cd4/tensorboard/plugins/profile/profile_plugin.py#L259
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with EventMultiplexer’s plugin asset retrieval and its regular Reload() cycle. Compare the current asynchronous work in tensorboard/plugins/projector/projector_plugin.py, tensorboard/plugins/text/text_plugin.py, and tensorboard/plugins/profile/profile_plugin.py. Done means asset results are refreshed during Reload() and then available from a cache for quick retrieval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100