Skip to content

Fix mlflow (oss models) metrics viz - #6102

Merged
mujtaba1747 merged 4 commits into
aws:master-nova-follow-upsfrom
mujtaba1747:master-nova-bugbash
Jul 27, 2026
Merged

Fix mlflow (oss models) metrics viz#6102
mujtaba1747 merged 4 commits into
aws:master-nova-follow-upsfrom
mujtaba1747:master-nova-bugbash

Conversation

@mujtaba1747

@mujtaba1747 mujtaba1747 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix related to mlflow (oss models) metrics visualization.

1. plot_training_metrics failed to render tall figures inline

When plotting many metrics, the combined figure grew too tall for the
inline backend to rasterize, so display(fig) produced no output. A
single-metric run also broke because plt.subplots returned a bare Axes
that couldn't be flattened.

Changes:

  • Return early with a warning when no metric history is found
  • Pass squeeze=False to plt.subplots so axes is always a 2D array
    that can be flattened, fixing the single-metric case
  • Render the figure to an in-memory PNG and embed it inside a scrollable
    HTML <div>, allowing all metrics to display without hitting the
    backend's pixel-count limits

Testing

  • Verified metrics plotting renders correctly for zero, one, and many
    metrics

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mujtaba1747 mujtaba1747 changed the title Fix mlflow metrics viz Fix mlflow (oss models) metrics viz Jul 24, 2026
@mujtaba1747
mujtaba1747 requested a review from zhaoqizqwang July 24, 2026 22:46
# calling display(fig) directly we render to an in-memory PNG and embed
# it inside a scrollable HTML <div>. This lets the notebook display all
# metrics without choking on pixel-count limits.
import io

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: these should move to the top level


# Embed as a scrollable HTML image in the notebook
b64 = base64.b64encode(buf.getvalue()).decode()
from IPython.display import HTML

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this also be top level?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Will move it.

@mujtaba1747
mujtaba1747 merged commit 0df4387 into aws:master-nova-follow-ups Jul 27, 2026
1 check was pending
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.

3 participants