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

Add option to request manual quit on tui #2489

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vincentmasse
Copy link
Contributor

Pull Request Template

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

#2233

Changes

Add option to learner builder to wait for user to quit the renderer.

Testing

Manual test, TUI waits for q to close.

@vincentmasse
Copy link
Contributor Author

I wasn't sure about the best way to implement this, particularly if adding it to the builder was the right approach. Let me know if you have any suggestions.

@vincentmasse
Copy link
Contributor Author

image
I got this error while running run_checks. I opened the PR since it's not linked with the changes I made. I suspect it's because the intel graphics used isn't implementing cooperative matrix multiplication.

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 45 lines in your changes missing coverage. Please review.

Project coverage is 82.56%. Comparing base (94db460) to head (b417f3a).
Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
crates/burn-train/src/renderer/tui/renderer.rs 0.00% 45 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2489      +/-   ##
==========================================
- Coverage   82.94%   82.56%   -0.38%     
==========================================
  Files         811      827      +16     
  Lines      105059   106757    +1698     
==========================================
+ Hits        87136    88143    +1007     
- Misses      17923    18614     +691     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Member

@laggui laggui left a comment

Choose a reason for hiding this comment

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

I think that's a great start! But I have a couple of general comments.

First, I'm not sure adding with_manual_quit is the best 🤔 especially since it doesn't apply to all renderers.

Instead, I think this could simply be added as an option for the TuiMetricsRenderer and users could explicitly provide the renderer in with_renderer(...) (at least for now).

Another thing I noticed is that it's not always clear when the training is done when keeping the TUI opened, especially if early stopping is used. Haven't had the time to look into it as much but it should be taken into consideration.

Copy link
Member

@laggui laggui left a comment

Choose a reason for hiding this comment

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

Ah that's pretty good!

I think we could make one minimal change, after which the usage would look something like this:

let learner = LearnerBuilder::new(ARTIFACT_DIR)
    // ...
    .devices(vec![device.clone()])
    .num_epochs(config.num_epochs)
    .summary();

let tui = TuiMetricsRenderer::new(learner.interrupter(), None).persistent();
let learner = learner
    .renderer(tui)
    .build(Model::new(&device), config.optimizer.init(), 1e-4);

While it "breaks" the builder pattern, I think it's perfectly fine for now. We could eventually improve this but I don't think it's a critical issue atm.

crates/burn-train/src/renderer/tui/renderer.rs Outdated Show resolved Hide resolved
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