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

Vectorize as_windowed #19

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Vectorize as_windowed #19

merged 1 commit into from
Aug 30, 2023

Conversation

jonatanklosko
Copy link
Member

@jonatanklosko jonatanklosko commented Aug 30, 2023

Significantly faster! 🚀

NxSignal.as_windowed(Nx.iota({10000}), window_length: 10, padding: :reflect, stride: 2)

1.2s -> 0.03s (with EXLA.Backend, re-run with cached computations)

lib/nx_signal.ex Show resolved Hide resolved
@jonatanklosko
Copy link
Member Author

Ah, clarification: there is no much difference when JIT-ting for the example below, which is already fast in both versions.

@jonatanklosko jonatanklosko merged commit f6c83e8 into main Aug 30, 2023
4 checks passed
@jonatanklosko jonatanklosko deleted the jk-optimization branch August 30, 2023 23:33
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