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: define interface for read_last_scalars #6657

Merged
merged 10 commits into from
Oct 30, 2023

Conversation

yatbear
Copy link
Member

@yatbear yatbear commented Oct 20, 2023

This will be used for hparams.backend_context.read_last_scalars.

Googlers, see b/292102513 for more context.

Tested internally at cl/577906864.

#hparams

@yatbear yatbear requested a review from arcra October 20, 2023 22:06
ctx=None,
*,
experiment_id,
plugin_name,
Copy link
Member

Choose a reason for hiding this comment

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

Since we're requiring plugin_name to be specified, I would think having the method be read_latest_values, or something like this, would be more generic/flexible, and we can say in the doc string that it's possible that not all plugins are supported by all implementations.

Although the return value does get a bit more difficult to specify and deal with, so if you prefer this because of this reason, I'm ok with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I specified plugin_name because read_scalars also requires plugin_name. I prefer the simpler definition for just the scalars, in this case do you think we can just remove the plugin_name arg?

Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to remove the plugin_name completely. I think it's unlikely that we'll have a new plugin type that contains scalar data in the near future. And since scalar seems to be the most used type, we don't have to generalize it to read_last_values just yet, wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, sorry for the late response. I thought I had replied to this. Technically, the plugin type is somewhat independent from the data type, e.g. there's a custom_scalars plugin in our examples, I believe, which also uses scalar values.

For this reason, and to be consistent with the rest of the interface for the data provider, I'd lean a bit towards keeping the plugin_name... but this is ok too. I agree it's unlikely we'll ever need anything other than "scalars", and if we do, we can change it later (but again, unlikely).

Copy link
Member Author

Choose a reason for hiding this comment

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

Great point, added it back.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also I didn't realize I also needed to implement this method in event_processing/data_provider. PTAL, thanks!

tensorboard/data/provider.py Outdated Show resolved Hide resolved
@yatbear yatbear requested a review from arcra October 23, 2023 13:50
ctx=None,
*,
experiment_id,
plugin_name,
Copy link
Member

Choose a reason for hiding this comment

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

Oh, sorry for the late response. I thought I had replied to this. Technically, the plugin type is somewhat independent from the data type, e.g. there's a custom_scalars plugin in our examples, I believe, which also uses scalar values.

For this reason, and to be consistent with the rest of the interface for the data provider, I'd lean a bit towards keeping the plugin_name... but this is ok too. I agree it's unlikely we'll ever need anything other than "scalars", and if we do, we can change it later (but again, unlikely).

@yatbear yatbear requested a review from arcra October 23, 2023 18:38
tensorboard/data/grpc_provider_test.py Outdated Show resolved Hide resolved
@yatbear yatbear merged commit d379d08 into tensorflow:master Oct 30, 2023
13 checks passed
@yatbear yatbear deleted the read_last_scalars branch October 30, 2023 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants