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

Use ProgressLogging instead of Juno #1859

Merged
merged 3 commits into from
Feb 4, 2022
Merged

Conversation

darsnack
Copy link
Member

@darsnack darsnack commented Feb 4, 2022

This replaces Juno with ProgressLogging. Closes #1807 and fixes #1779.

This overcomes the _linindex issue by manually updating the progress using @logprogress and calling length instead. In the case of infinite iterators, the code will still run but we don't have a clear way to measure progress (so the bar will jump from 0 to 100).

One possible issue is infinite iterators that improperly implement the Base iterator interface. Right now this PR takes the "implement the interface correctly" stance, but we could also try/catch on length.

PR Checklist

  • Tests are added
  • Entry in NEWS.md
  • Documentation, if applicable

@CarloLucibello
Copy link
Member

Compat bound missing

@@ -120,6 +121,7 @@ function train!(loss, ps, data, opt; cb = () -> ())
rethrow(ex)
end
end
@logprogress i / n
Copy link
Member

Choose a reason for hiding this comment

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

How does @logprogress handle Inf here? Is it possible to make the progress bar indeterminate if n == 0?

Copy link
Member Author

Choose a reason for hiding this comment

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

The progress will just show up as 0% until the end of the loop then jump to 100%. I think @logprogress accepts NaN or Inf as part of its API to indicate a "no-op."

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no API for indeterminate, just lots of discussion on the ProgressLogging issues. It's unclear to me that we'd be able to take advantage of the proposed APIs too, because we don't know the criteria used to measure convergence.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking something along the lines of what tqdm does (just report it/s or s/it), but good to know.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah maybe we can use something like this eventually: JuliaLogging/ProgressLogging.jl#23. Right now I think it requires a specific frontend for ProgressLogging to work how we want it. It doesn't work with the VSCode frontend.

Copy link

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I thought nothing has the same behavior as NaN (at least in VS Code).

@darsnack darsnack merged commit d0a5b77 into FluxML:master Feb 4, 2022
@darsnack darsnack deleted the rm-juno branch February 4, 2022 19:10
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.

Remove Juno.jl dependency
4 participants