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

data: expose downsampling preferences to plugins #3271

Merged
merged 1 commit into from
Feb 21, 2020

Conversation

wchargin
Copy link
Contributor

Summary:
We add a sampling_hints attribute to the TBContext magic container,
which is populated with the parsed form of the --samples_per_plugin
flag. Existing plugins’ generic data modes are updated to read from this
map instead of using hard-coded thresholds.

Test Plan:
This change is not actually observable as is, because the multiplexer
data provider ignores its downsampling argument. But after patching in a
change to make the data provider respect the downsampling argument, this
change has the effect that increasing the --samples_per_plugin over
the default (e.g., images=20) now properly increases the number of
samples shown in generic data mode, whereas previously it had no effect.

wchargin-branch: data-downsampling-flag

Summary:
We add a `sampling_hints` attribute to the `TBContext` magic container,
which is populated with the parsed form of the `--samples_per_plugin`
flag. Existing plugins’ generic data modes are updated to read from this
map instead of using hard-coded thresholds.

Test Plan:
This change is not actually observable as is, because the multiplexer
data provider ignores its downsampling argument. But after patching in a
change to make the data provider respect the downsampling argument, this
change has the effect that increasing the `--samples_per_plugin` over
the default (e.g., `images=20`) now properly increases the number of
samples shown in generic data mode, whereas previously it had no effect.

wchargin-branch: data-downsampling-flag
wchargin-source: 50998be15abd790a0915458bac76091c79823f0f
@@ -238,6 +242,7 @@ def TensorBoardWSGIApp(
multiplexer=deprecated_multiplexer,
assets_zip_provider=assets_zip_provider,
plugin_name_to_instance=plugin_name_to_instance,
sampling_hints=_parse_samples_per_plugin(flags),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Parsing this twice felt easier than adding an extra parameter to this
method, but I’d be happy to change that if others object.

@wchargin wchargin requested review from nfelt and stephanwlee and removed request for nfelt February 20, 2020 21:32
@wchargin
Copy link
Contributor Author

(Reassigning just to spread load.)

@wchargin wchargin merged commit 5b7f9ad into master Feb 21, 2020
@wchargin wchargin deleted the wchargin-data-downsampling-flag branch February 21, 2020 07:04
wchargin added a commit that referenced this pull request Aug 18, 2020
Summary:
Before `--samples_per_plugin` existed, the only way to change the
sampling thresholds was to patch `application.py` manually. But the flag
has been the right way to do this since #1138, and manual patching has
been insufficient since the flag value was exposed to plugins in #3271.
There’s no need to discuss this implementation detail any more.

wchargin-branch: readme-remove-application-reference
wchargin-source: b79027ec8b279537bdf38f7b5d7f36cf5dd38498
wchargin added a commit that referenced this pull request Aug 18, 2020
Summary:
Before `--samples_per_plugin` existed, the only way to change the
sampling thresholds was to patch `application.py` manually. But the flag
has been the right way to do this since #1138, and manual patching has
been insufficient since the flag value was exposed to plugins in #3271.
There’s no need to discuss this implementation detail any more.

wchargin-branch: readme-remove-application-reference
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

3 participants