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

Implement streaming annotations #51

Merged
merged 6 commits into from Nov 12, 2021
Merged

Conversation

yetinam
Copy link
Member

@yetinam yetinam commented Nov 10, 2021

This commit implements streaming processing for WaveformModels. This has several advantages:

  • Enables parallelization between and within each step
  • Allows batching across multiple stations, thereby improving GPU utilization
  • Reduces memory consumption for point prediction models in case of long traces

As this only modifies the backend, but does not introduce any changes in the user interface, I'd suggest to publish it as 0.1.8 (instead of 0.2.0), even though it's technically not a bugfix. What do you think @jawooll ? In addition, because it's a somewhat more complicated change, I'd ask you to have a look at it.

Closes #40

… object

Minimizing information passed to allow for future buffering of trace.stats without storing the full trace.
Based on asyncio, the different steps of running predictions on streams are now implemented as coroutines. Therefore they can be run in parallel. This improves both CPU and GPU utilization. In addition, batching is now possible across stations, leading to performance improvements when annotating many small input fragments. When annotating long traces with point-prediction models, the new implementation also reduces memory consumption, as not all waveform fragments are created at once.
@yetinam yetinam added the enhancement New feature or request label Nov 10, 2021
@yetinam yetinam requested a review from jawooll November 10, 2021 14:51
@jawooll
Copy link
Contributor

jawooll commented Nov 10, 2021

Hey thanks for implementing this! I agree with publishing to 0.1.8 as the user interface hasn't changed - makes sense. I'll take a look and get back to you.

@yetinam yetinam linked an issue Nov 11, 2021 that may be closed by this pull request
@jawooll
Copy link
Contributor

jawooll commented Nov 12, 2021

I've run across datasets and waveforms (similar to the unit test cases you implement but just for seismic examples with various models). All looks good. Merging now.

@jawooll jawooll merged commit 2ceee5f into maintenance_0.1.x Nov 12, 2021
@jawooll jawooll deleted the streaming_annotations branch November 12, 2021 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to streaming annotation for WaveformModel annotate
2 participants