Skip to content

Conversation

@rileyajones
Copy link
Contributor

Reverts #6318

@rileyajones rileyajones merged commit 42e85eb into master Apr 18, 2023
@rileyajones rileyajones deleted the revert-6318-hparams-datasource branch April 18, 2023 21:07
rileyajones added a commit that referenced this pull request Apr 20, 2023
#6337)

## Motivation for features / changes
In #6318 I ported over the runs_data_source from internal tensorboard in
order to begin fetching hparams data in the timeseries dashboard.
However, I later learned that it didn't play well with internal Colab
which does not allow POST requests and thus had to revert the change in
#6336.

## Technical description of changes
The current implementation of this "hackaround" converts post bodies to
query params and assumes that all post bodies are of type `FormData`.
This does not work in this situation for two reasons:
1) HParams Plugin backend does not accept `FormData`
2) The [the hparams
plugin](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/hparams/hparams_plugin.py#L191)
only expects GET requests to have a query parameter titled "request"
which is a serialized JSON object.

## Screenshots of UI changes
N/A

## Alternate designs / implementations considered
I considered modifying the hparams plugin to accept many query
parameters but decided that the logic required to convert them to a
single JSON object (including nested objects/arrays and parsing numbers)
was messier than the just doing it on the client.
rileyajones added a commit that referenced this pull request Apr 25, 2023
…take 2 (#6340)

## Motivation for features / changes
As part of the effort to surface hparams data in the time series
dashboard we need to start actually fetching it. The logic existed
internally but for some reason was not previously available in OSS.

I originally attempted this in #6318 but due to incompatibilities with
internal Colab had to revert it in #6336.
The issue was that Colab does not allow `POST` requests and our method
of mapping POST requests to GET requests didn't meet the expectations of
the hparams_plugin backend.

I've improved the tb_http_client in #6337 to now work with the
hparams_plugin backend so this should now be fine

## Technical description of changes
I mostly copied the internal code to the oss implementation and made a
few small adjustments to imports.
The biggest change is that I now utilize the `serializeUnder` parameter
of our custom POST function to ensure the requests meet the expectations
of the hparams backend

## Screenshots of UI changes
### enableHparamsInTimeSeries=false&tensorboardColab=false

![image](https://user-images.githubusercontent.com/78179109/233498859-df60aa0b-43d0-486d-8e4a-5be8fab7d08e.png)

### enableHparamsInTimeSeries=true&tensorboardColab=false

![image](https://user-images.githubusercontent.com/78179109/233498895-01e6e773-faf7-41de-9e34-199925a3e80f.png)

### enableHparamsInTimeSeries=false&tensorboardColab=true

![image](https://user-images.githubusercontent.com/78179109/233498942-fc414b81-256b-4762-837b-56148dc1dbcf.png)

### enableHparamsInTimeSeries=true&tensorboardColab=true

![image](https://user-images.githubusercontent.com/78179109/233498974-c9fd8555-db2a-49e4-9188-b7c19cfaaddf.png)



## Detailed steps to verify changes work correctly (as executed by you)
I ensured all of the above states result in the runs table being
displayed properly and that no errors are thrown by the hparams plugin
backend
dna2github pushed a commit to dna2fork/tensorboard that referenced this pull request May 1, 2023
tensorflow#6337)

## Motivation for features / changes
In tensorflow#6318 I ported over the runs_data_source from internal tensorboard in
order to begin fetching hparams data in the timeseries dashboard.
However, I later learned that it didn't play well with internal Colab
which does not allow POST requests and thus had to revert the change in
tensorflow#6336.

## Technical description of changes
The current implementation of this "hackaround" converts post bodies to
query params and assumes that all post bodies are of type `FormData`.
This does not work in this situation for two reasons:
1) HParams Plugin backend does not accept `FormData`
2) The [the hparams
plugin](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/hparams/hparams_plugin.py#L191)
only expects GET requests to have a query parameter titled "request"
which is a serialized JSON object.

## Screenshots of UI changes
N/A

## Alternate designs / implementations considered
I considered modifying the hparams plugin to accept many query
parameters but decided that the logic required to convert them to a
single JSON object (including nested objects/arrays and parsing numbers)
was messier than the just doing it on the client.
dna2github pushed a commit to dna2fork/tensorboard that referenced this pull request May 1, 2023
…take 2 (tensorflow#6340)

## Motivation for features / changes
As part of the effort to surface hparams data in the time series
dashboard we need to start actually fetching it. The logic existed
internally but for some reason was not previously available in OSS.

I originally attempted this in tensorflow#6318 but due to incompatibilities with
internal Colab had to revert it in tensorflow#6336.
The issue was that Colab does not allow `POST` requests and our method
of mapping POST requests to GET requests didn't meet the expectations of
the hparams_plugin backend.

I've improved the tb_http_client in tensorflow#6337 to now work with the
hparams_plugin backend so this should now be fine

## Technical description of changes
I mostly copied the internal code to the oss implementation and made a
few small adjustments to imports.
The biggest change is that I now utilize the `serializeUnder` parameter
of our custom POST function to ensure the requests meet the expectations
of the hparams backend

## Screenshots of UI changes
### enableHparamsInTimeSeries=false&tensorboardColab=false

![image](https://user-images.githubusercontent.com/78179109/233498859-df60aa0b-43d0-486d-8e4a-5be8fab7d08e.png)

### enableHparamsInTimeSeries=true&tensorboardColab=false

![image](https://user-images.githubusercontent.com/78179109/233498895-01e6e773-faf7-41de-9e34-199925a3e80f.png)

### enableHparamsInTimeSeries=false&tensorboardColab=true

![image](https://user-images.githubusercontent.com/78179109/233498942-fc414b81-256b-4762-837b-56148dc1dbcf.png)

### enableHparamsInTimeSeries=true&tensorboardColab=true

![image](https://user-images.githubusercontent.com/78179109/233498974-c9fd8555-db2a-49e4-9188-b7c19cfaaddf.png)



## Detailed steps to verify changes work correctly (as executed by you)
I ensured all of the above states result in the runs table being
displayed properly and that no errors are thrown by the hparams plugin
backend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants