docs(aggregation): Add hosted interactive plotter webapp - #772
docs(aggregation): Add hosted interactive plotter webapp#772KhusPatel4450 wants to merge 6 commits into
Conversation
|
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? |
|
Having docker sdk requires a paid hugging face plan. Is there a way to do it with the Static SDK? Or using another provider? |
|
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 |
|
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>
|
here is the space: https://huggingface.co/spaces/Hsuhk20/torchjd-plotter |
ValerianRey
left a comment
There was a problem hiding this comment.
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 .
| 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. |
There was a problem hiding this comment.
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
|
||
| on: | ||
| push: | ||
| branches: [main] |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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']) |
There was a problem hiding this comment.
This lines implies that we store a HF_TOKEN as a repo secret or something, right?
There was a problem hiding this comment.
Yes, HF_TOKEN would be stored as a GitHub Actions repository secret (Under Settings)
|
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 |
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>
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 tomain.visualization/app.py, Dash app refactored fromtests/plots/interactive_plotter.pyvisualization/_utils.py, plotting utilities (copy oftests/plots/_utils.py)visualization/requirements.txt+visualization/Dockerfile, for HF Spaces (Docker SDK)visualization/README.md, HF Spaces metadata.github/workflows/deploy-visualization.yml, deploysvisualization/to HF Spaces on push tomainThe 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:
torchjd/interactive-plotterwith Docker as the SDKHF_TOKEN(an HF token with write access to that Space) as a GitHub Actions secretOnce those are in place, any push to
mainthat touchesvisualization/will redeploy automatically