Skip to content

docs(aggregation): Add hosted interactive plotter webapp - #772

Open
KhusPatel4450 wants to merge 6 commits into
SimplexLab:mainfrom
KhusPatel4450:feat/interactive-plotter-webapp
Open

docs(aggregation): Add hosted interactive plotter webapp#772
KhusPatel4450 wants to merge 6 commits into
SimplexLab:mainfrom
KhusPatel4450:feat/interactive-plotter-webapp

Conversation

@KhusPatel4450

Copy link
Copy Markdown
Contributor

Adds a self-contained Dash webapp in visualization/ that hosts the interactive gradient plotter, and a GitHub Actions workflow that auto-deploys it to Hugging Face Spaces on every push to main.

  • visualization/app.py, Dash app refactored from tests/plots/interactive_plotter.py
  • visualization/_utils.py, plotting utilities (copy of tests/plots/_utils.py)
  • visualization/requirements.txt + visualization/Dockerfile, for HF Spaces (Docker SDK)
  • visualization/README.md, HF Spaces metadata
  • .github/workflows/deploy-visualization.yml, deploys visualization/ to HF Spaces on push to main

The app accepts query parameters so individual aggregator pages can embed it with a pre-selected method (as suggested by @PierreQuinton)

Before we can deploy we need to do this:

  1. Create a Hugging Face Space at torchjd/interactive-plotter with Docker as the SDK
  2. Add HF_TOKEN (an HF token with write access to that Space) as a GitHub Actions secret

Once those are in place, any push to main that touches visualization/ will redeploy automatically

@KhusPatel4450 KhusPatel4450 added the cc: feat Conventional commit type for new features. label Aug 1, 2026
@ValerianRey

ValerianRey commented Aug 1, 2026

Copy link
Copy Markdown
Member

Thank you very much for taking this! Could you deploy it on under some random name on HF so that we can test it already?

@ValerianRey ValerianRey added cc: docs Conventional commit type for changes to the documentation. package: aggregation and removed cc: feat Conventional commit type for new features. labels Aug 1, 2026
@github-actions github-actions Bot changed the title feat: Add hosted interactive plotter webapp docs(aggregation): Add hosted interactive plotter webapp Aug 1, 2026
@PierreQuinton

Copy link
Copy Markdown
Contributor

Having docker sdk requires a paid hugging face plan. Is there a way to do it with the Static SDK? Or using another provider?

@KhusPatel4450

Copy link
Copy Markdown
Contributor Author

yeah you are right, it does required a paid plan, didn't realize that, anyway i am in the process of converting it to gradio, that one is free

@KhusPatel4450

Copy link
Copy Markdown
Contributor Author

okay looks like Gradio is paid too, I am just going to get the HF pro subscription, its pretty cheap, plus we can't do static because it doesn't support python

…bility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@KhusPatel4450

Copy link
Copy Markdown
Contributor Author

here is the space: https://huggingface.co/spaces/Hsuhk20/torchjd-plotter

@ValerianRey ValerianRey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I just tried: very cool!

What's the price of the HF pro subscription? Is there any risk of extra cost if people use this heavily (I've heard of people getting unexpected 300$ extra cost from HF by using their pro plan).

Should we create a HF pro account for SimplexLab and use it for that? Especially if the HF_TOKEN, with access to this account, has to be stored in the repo. Then it's not a good thing if it's linked to a personal account. And I'd rather not have you pay for this @KhusPatel4450 .

Comment thread visualization/README.md Outdated
Interactive visualization of gradient aggregation methods from [TorchJD](https://torchjd.org).

Adjust the angle and length of each gradient vector and select aggregators to see how they combine
the gradients. The green region shows the dual cone — any descent direction must lie inside it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
the gradients. The green region shows the dual cone — any descent direction must lie inside it.
the gradients. The green region shows the dual cone: the set of vectors with a
non-negative inner product with each gradient.

Comment thread visualization/_utils.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we avoid code duplication between this and tests/plots/? I think we may want to move app.py, the newly added README.md and requirements.txt to tests/plots/. I still want to be able to run the thing locally (what interactive_plotter.py does) because it's more responsive to it's a good tool for us when working on new aggregators.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah I mean good point, this could be done easily, the GitHub Actions workflow would just need to point at tests/plots/. I am happy to restructure it if you think that's cleaner

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes please go ahead!


on:
push:
branches: [main]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we deploy only on new releases (it's when we may actually change the behavior of aggregators / release new aggregators to our users) + manually if needed (e.g. if we update the plotter) (manually = workflow_dispatch in github terminology)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

okay yeah I could apply this, I think that's a better trigger

python -c "
import os
from huggingface_hub import HfApi
api = HfApi(token=os.environ['HF_TOKEN'])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This lines implies that we store a HF_TOKEN as a repo secret or something, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, HF_TOKEN would be stored as a GitHub Actions repository secret (Under Settings)

@KhusPatel4450

Copy link
Copy Markdown
Contributor Author

Hello,

I am pretty sure those stories that you have heard happened because of leaving GPU hardware running, CPU Basic (what we use) is a flat included cost with Pro, not usage-based, the cost is $9 per month.

We could make it for simplex lab org too, I think it makes sense too, I don't really mind paying for it though

KhusPatel4450 and others added 3 commits August 2, 2026 18:14
Move app.py, README.md, and requirements.txt from visualization/ into
tests/plots/ so they share _utils.py with the existing plotters. Update
the deploy workflow to point at tests/plots/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: docs Conventional commit type for changes to the documentation. package: aggregation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants