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

projector: read run names from data provider #4494

Merged
merged 7 commits into from Jan 5, 2021

Conversation

wchargin
Copy link
Contributor

@wchargin wchargin commented Dec 17, 2020

Summary:
The projector plugin no longer depends on the event multiplexer. It
finds run directories by calling list_runs to get run names and
adjoining those to the value of the --logdir flag. This still only
works with a local logdir (as was also the case before this patch), but
now it works even when the data provider is not backed by a multiplexer.

The data provider interface does not mandate that run names be valid
relative paths under a logdir, but that does hold for the two data
providers that we care about: the multiplexer provider and the RustBoard
provider. Making the projector plugin truly portable will require much
deeper changes, so we don’t bother with anything more principled here.

This will certainly not work with --logdir_spec; the old version may
or may not have worked. The docs for --logdir_spec clearly disclaim
that it may cause some features to stop working, so I’m okay with this.

Test Plan:
Tested on a logdir whose projector_config.pbtxt is under plugin assets
and one whose config is in the main run directory. You can tell that
it’s properly reading the config because otherwise the sprite sheet
won’t show up. The projector plugin no longer contains any occurrences
of the word multiplexer, and it still works under --load_fast, which
does not create a multiplexer at all. Test sync also passes.

wchargin-branch: projector-data-provider-run-names

Summary:
The projector plugin no longer depends on the event multiplexer. It
finds run directories by calling `list_runs` to get run names and
adjoining those to the value of the `--logdir` flag. This still only
works with a local logdir (as was also the case before this patch), but
now it works even when the data provider is not backed by a multiplexer.

The data provider interface does not mandate that run names be valid
relative paths under a logdir, but that does hold for the two data
providers that we care about: the multiplexer provider and the RustBoard
provider. Making the projector plugin truly portable will require much
deeper changes, so we don’t bother with anything more principled here.

This will certainly not work with `--logdir_spec`; the old version may
or may not have worked. The docs for `--logdir_spec` clearly disclaim
that it may cause some features to stop working, so I’m okay with this.

Test Plan:
Tested on a logdir whose `projector_config.pbtxt` is under plugin assets
and one whose config is in the main run directory. You can tell that
it’s properly reading the config because otherwise the sprite sheet
won’t show up. The projector plugin no longer contains any occurrences
of the word `multiplexer`, and it still works under `--load_fast`, which
does not create a multiplexer at all.

wchargin-branch: projector-data-provider-run-names
wchargin-source: aa06452ae259240118ffe91585b9ab6b1e43975b
@wchargin wchargin added plugin:projector core:rustboard //tensorboard/data/server/... labels Dec 17, 2020
@google-cla google-cla bot added the cla: yes label Dec 17, 2020
Summary:
This rolls forward #4479 (see that commit for context) with changes due
to Google-internal, non-TensorBoard code that monkey patches some of the
projector internals:

  - The `_run_paths` field is now updated only during `_update_configs`,
    to ensure that each change to `_run_paths` gives `_configs` the
    opportunity to update.
  - Configs/run paths are no longer updated in `__init__`, since that
    may be expensive and involve file access (even with a multiplexer).
  - The `_run_paths` field is now always a `dict` rather than `None`,
    fixing an existing bug wherein accessing `configs` on a plugin with
    no multiplexer would raise an `AttributeError`.

This reverts commit 4c9a699, and
therefore reinstates commit 638014e.

Test Plan:
Test plan from #4479 still passes, and a test sync now passes as well.
Also tested pointing the projector at a logdir with no runs but with
checkpoint data at root, as fixed in #3694; this worked in the original
version of this change (#4479), but it works now, too.

wchargin-branch: projector-fix-aliasing
wchargin-source: 0cb7e9c3917d5dc9f00616e35aa5bf756a51dea0
@wchargin wchargin changed the base branch from master to wchargin-projector-fix-aliasing December 23, 2020 21:47
wchargin-branch: projector-data-provider-run-names
wchargin-source: 0bdafa0a24cd27648ed0a3fd421f4e96ac49bff2

# Conflicts:
#	tensorboard/plugins/projector/projector_plugin.py
wchargin-branch: projector-data-provider-run-names
wchargin-source: 0bdafa0a24cd27648ed0a3fd421f4e96ac49bff2
@wchargin
Copy link
Contributor Author

I’ve rolled back #4479 and rolled it forward as #4508, so this pull
request now depends on #4508.

@@ -524,7 +533,8 @@ def _append_plugin_asset_directories(self, run_path_pairs):
metadata.PLUGIN_ASSETS_NAME,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe replace this with plugin_assets_name, since we've extracted it in L525?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, indeed. Thanks.

Base automatically changed from wchargin-projector-fix-aliasing to master January 5, 2021 23:14
wchargin-branch: projector-data-provider-run-names
wchargin-source: f2ef64702fbff9fd0daff7b2780d18e58902f31d

# Conflicts:
#	tensorboard/plugins/projector/projector_plugin.py
wchargin-branch: projector-data-provider-run-names
wchargin-source: f2ef64702fbff9fd0daff7b2780d18e58902f31d
wchargin-branch: projector-data-provider-run-names
wchargin-source: f353faf4468fdcf4cb733130ba5ee949c13cdee6
@wchargin wchargin merged commit 828d89f into master Jan 5, 2021
@wchargin wchargin deleted the wchargin-projector-data-provider-run-names branch January 5, 2021 23:52
@wchargin wchargin mentioned this pull request Jan 12, 2021
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants