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

Faster dataloader #900

Merged
merged 3 commits into from
Oct 11, 2022
Merged

Faster dataloader #900

merged 3 commits into from
Oct 11, 2022

Conversation

dfalbel
Copy link
Member

@dfalbel dfalbel commented Oct 10, 2022

Improve dataloaders performance.

  • No longer use coro::generator() in critical parts as it adds a lot of overhead.
  • Don't use coro::as_iterator() as this will use <<- from coro, making it slower.
  • nit: Don't recreate sliced tensor using Tensor$new() as it adds small overhead and is no longer necessary.
  • Vectorized batch samplers allow for faster loading. Specially if using .getbatch instead of .getitem().

… it's much faster. Also don't use `coro::as_iterator()` as it dispatches to coro's `<<-` that is much slower than base R's.
@dfalbel dfalbel merged commit 48832d3 into main Oct 11, 2022
@dfalbel dfalbel deleted the faster-dataloader branch October 11, 2022 15:55
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.

1 participant