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

added progress bar #20

Merged
merged 4 commits into from
Apr 3, 2024
Merged

added progress bar #20

merged 4 commits into from
Apr 3, 2024

Conversation

AlexErrant
Copy link
Member

@AlexErrant AlexErrant commented Apr 2, 2024

Closes #15

I eventually went with a solution that involved polling and reading from shared memory. Here's a high level overview:

  • We create a Progress.new() struct in the web-worker and pass that to computeParameters.
  • We use the pointer() method to get the memory address of Progress for Javascript's usage.
  • Rust writes itemsProcessed and itemsTotal to the memory address of Progress.
  • The Javascript main (UI) thread polls that memory address for updates.

The Javascript API for the Progress functionality is... not good, since the memory has to be instantiated in the worker thread, passed to Rust, and also passed to the main JS thread. I'm open to ideas on how to make it better!

@ishiko732
Copy link
Contributor

Is this 'progress' parameter required, or can it be optional?

@AlexErrant
Copy link
Member Author

Whoops, I just made it optional!

Copy link
Member

@L-M-Sherlock L-M-Sherlock left a comment

Choose a reason for hiding this comment

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

LGTM

@L-M-Sherlock L-M-Sherlock merged commit 5bae61b into main Apr 3, 2024
1 check passed
@L-M-Sherlock L-M-Sherlock deleted the progress-bar branch April 3, 2024 15:07
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.

Is it possible to support progress bar for the training process?
3 participants