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

feat: Add charts to Comparison View (ET-99) #9215

Merged
merged 27 commits into from
May 21, 2024
Merged

feat: Add charts to Comparison View (ET-99) #9215

merged 27 commits into from
May 21, 2024

Conversation

johnkim-det
Copy link
Contributor

@johnkim-det johnkim-det commented Apr 22, 2024

Ticket

ET-99

Description

Adding "Scatter Plots" and "Heat Map" charts to comparison view on Experiments list page

Test Plan

  • Select a multi-trial experiment to display in comparison view.
  • Compare what's displayed in the Scatter Plots and Heat Map charts with what's displayed for the experiment's best trial on the Experiment Details page (Visualization tab, HP Scatter Plots and HP Heat Map sub-tabs)
  • Make sure that the filters for selecting HPs, Metric, and Scale update the charts as expected

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

@johnkim-det johnkim-det requested a review from a team as a code owner April 22, 2024 17:01
@cla-bot cla-bot bot added the cla-signed label Apr 22, 2024
Copy link

netlify bot commented Apr 22, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit 27cca86
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/664ca41bc7b123000809021b
😎 Deploy Preview https://deploy-preview-9215--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@johnkim-det johnkim-det requested review from hkang1 and removed request for thiagodallacqua-hpe April 22, 2024 17:02
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 85.72469% with 196 lines in your changes are missing coverage. Please review.

Project coverage is 40.78%. Comparing base (53edec9) to head (27cca86).
Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9215      +/-   ##
==========================================
- Coverage   45.28%   40.78%   -4.51%     
==========================================
  Files        1227      907     -320     
  Lines      154095   115425   -38670     
  Branches     2403     2672     +269     
==========================================
- Hits        69782    47074   -22708     
+ Misses      84121    68174   -15947     
+ Partials      192      177      -15     
Flag Coverage Δ
harness ?
web 40.02% <85.72%> (+3.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../src/components/CompareHyperparameters.settings.ts 100.00% <100.00%> (ø)
...rc/components/CompareHyperparameters.test.mock.tsx 100.00% <100.00%> (ø)
...eact/src/components/CompareParallelCoordinates.tsx 90.86% <100.00%> (+90.86%) ⬆️
...bui/react/src/components/GalleryModalComponent.tsx 91.48% <100.00%> (+91.48%) ⬆️
webui/react/src/components/ParallelCoordinates.tsx 90.51% <100.00%> (+90.51%) ⬆️
webui/react/src/types.ts 99.68% <100.00%> (+<0.01%) ⬆️
webui/react/src/services/decoder.ts 20.44% <0.00%> (-0.03%) ⬇️
webui/react/src/components/ComparisonView.tsx 0.00% <0.00%> (ø)
...UPlot/UPlotScatter/useScatterPointTooltipPlugin.ts 46.38% <33.33%> (+46.38%) ⬆️
webui/react/src/components/UPlot/UPlotChart.tsx 61.93% <16.66%> (+48.86%) ⬆️
... and 6 more

... and 337 files with indirect coverage changes

Copy link
Contributor

@hkang1 hkang1 left a comment

Choose a reason for hiding this comment

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

This looks mostly good, haven't had time to try it out but the code looks good. Let some questions and comments through out.

@johnkim-det
Copy link
Contributor Author

Will look at @hkang1's comments but he also let me know that he might not have time for more detailed review. originally asked him because he worked on this before, but now tagging @keita-determined and @thiagodallacqua-hpe too, can you please take a look as well?

Copy link
Contributor

@keita-determined keita-determined left a comment

Choose a reason for hiding this comment

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

not fully reviewed yet, but so far i found these.

only the Heat Map chart goes out of container. is it expected?
qq: iirc, each chart has a tab. All the charts are shown in the single page?

Screen.Recording.2024-04-25.at.2.49.32.PM.mov

theres scroll bar on hover. it looks like a bug

Screen.Recording.2024-04-25.at.3.00.28.PM.mov

chartData?.hpMetrics[key] || [],
chartData?.trialIds || [],
],
] as FacetedData,
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we should avoid as as much as possible cuz it leads to the bug easily

Copy link
Contributor Author

Choose a reason for hiding this comment

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

discussed with caleb and I think it makes sense to keep this particular assertion for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nvm, did remove

webui/react/src/components/CompareScatterPlots.tsx Outdated Show resolved Hide resolved
@johnkim-det
Copy link
Contributor Author

updated

  • fix for horizontal space issue
  • rename ExperimentHyperparametersSettings
  • remove type assertions from ScatterPlots

@hkang1 hkang1 assigned johnkim-det and unassigned hkang1 May 2, 2024
Copy link
Contributor

@hkang1 hkang1 left a comment

Choose a reason for hiding this comment

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

The UI looks great. On the details it looks like the fact that heat maps is unable to render categorical axes is a known issue that also exists in the experiment detail so it is not a newly introduced problem. It can probably just be a entirely separate PR to get that resolved. I haven't had a chance to take a real in-depth look but scanning through the code, nothing other than nits stood out, could probably use someone else's more in-depth look to shake out any potential problems.

Copy link
Contributor

@keita-determined keita-determined left a comment

Choose a reason for hiding this comment

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

mostly working good. some finding. also the code is massive so i might add some more comments later


when i select paused experiments, parallel coord is not displayed.

Screen.Recording.2024-05-06.at.3.10.21.PM.mov

webui/react/src/components/CompareHeatMaps.tsx Outdated Show resolved Hide resolved
webui/react/src/components/CompareHeatMaps.tsx Outdated Show resolved Hide resolved
webui/react/src/components/CompareHeatMaps.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

qq: there is only one axis value in y axis with log scale. is it expected? looks like some axis values are missing.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is okay? I would definitely be concerned if log scale always only displayed one value, but it seems to depend on the value, and I think it makes sense that log scale would not have evenly spaced values.

Screenshot 2024-05-10 at 11 52 56 AM Screenshot 2024-05-10 at 11 49 28 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm interesting. yeah ok its not a blocking issue then

Copy link
Contributor

Choose a reason for hiding this comment

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

log scale isnt applied in heat map

Screen.Recording.2024-05-06.at.2.52.06.PM.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice catch, this was not working on the existing HpHeatMaps chart either

Copy link
Contributor

Choose a reason for hiding this comment

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

do you think its a blocker or non-blocker?

webui/react/src/components/CompareHeatMaps.tsx Outdated Show resolved Hide resolved
webui/react/src/components/CompareScatterPlots.tsx Outdated Show resolved Hide resolved
@johnkim-det
Copy link
Contributor Author

Pushed fixes for @keita-determined's last review, and also was able to address what @hkang1 mentioned regarding categorical axis labeling.

The one remaining issue right now is what happens with Parallel Coordinates when experiments with different metrics/hyperparameters are compared (I think this is the cause rather than the "Pause" state). FWIW it is a pre-existing issue and arguably could be considered out of scope of this PR, but I'll spend some time looking at it -- if I really can't make progress on it I might push for a separate ticket to address.

@keita-determined
Copy link
Contributor

@johnkim-det okay. i'll review the PR after fixing or file the issue.

@johnkim-det
Copy link
Contributor Author

created https://hpe-aiatscale.atlassian.net/browse/ET-261 for the Parallel Coordinates issue.

Copy link
Contributor

@hkang1 hkang1 left a comment

Choose a reason for hiding this comment

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

the basic sanity tests around making sure they render and have the titles look good. One suggestion to handle the case if the shape of the mocked data changes (due to API client changing)

webui/react/src/components/CompareHyperparameters.tsx Outdated Show resolved Hide resolved
import { Scale } from 'types';

import CompareHyperparameters from './CompareHyperparameters';
export const METRIC_DATA = {
Copy link
Contributor

Choose a reason for hiding this comment

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

for the mock data, are there api-ts-sdk client types that can be associated with it? For example if there was a MetricData type exported from api-ts-sdk then you can do export const METRIC_DATA: MetricData = { and if the shape changes in the future this test would capture the change.

If MetricData is not available and METRIC_DATA is actually a form of a processed data, it might be better to mock the unprocessed data with the corresponding typing and then converting it to METRIC_DATA to capture the benefit mentioned above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not from api-ts-sdk but adding typing with TrialMetricData from useTrialMetrics

Copy link
Contributor

@keita-determined keita-determined left a comment

Choose a reason for hiding this comment

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

the selected experiments are deselected in a certain conditions. not exactly sure how to reproduce it, but if i select complete experiments and running experiments` it happens. if this bug is not related to the PR, its not a blocker.

Screen.Recording.2024-05-14.at.11.02.28.AM.mov

nit design bug: still see the height change on hover, when there are few charts in the board.

Screen.Recording.2024-05-14.at.11.02.48.AM.mov

@johnkim-det
Copy link
Contributor Author

@keita-determined not sure if this will make sure it never happens, but added a change to Scatter Plots and Heat Maps charts to avoid width being too narrow for tooltip and creating a horizontal scrollbar.

As for the other issue, I think I'm seeing the same thing on latest-main so it's not part of this PR, but I created https://hpe-aiatscale.atlassian.net/browse/ET-264. Can you confirm it's the same thing you're seeing? I'm trying to add more info for reproduction or to try to identify the cause, would be nice if you could look at that too.

Copy link
Contributor

@keita-determined keita-determined left a comment

Choose a reason for hiding this comment

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

one comment, otherwise LGTM
the code around charts has been complicated. hope we can have time to refactor code.

resetSettings,
} = useSettings<CompareHyperparametersSettings>(settingsConfig);

const selectedScale = settings.scale;
Copy link
Contributor

@keita-determined keita-determined May 20, 2024

Choose a reason for hiding this comment

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

ideally we wanna remove the useEffect and use the update function in somewhere where settings.scale is updated.
if its hard to do, can we move it into useEffect? looks like its only used in useEffect

@keita-determined
Copy link
Contributor

As for the other issue, I think I'm seeing the same thing on latest-main so it's not part of this PR, but I created https://hpe-aiatscale.atlassian.net/browse/ET-264. Can you confirm it's the same thing you're seeing? I'm trying to add more info for reproduction or to try to identify the cause, would be nice if you could look at that too.

looks like its the same issue

@johnkim-det johnkim-det merged commit cb81a44 into main May 21, 2024
83 of 96 checks passed
@johnkim-det johnkim-det deleted the ET-99 branch May 21, 2024 15:51
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.

3 participants