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

Add fast path for large arrays. #2162

Merged
merged 7 commits into from
Jul 3, 2024
Merged

Add fast path for large arrays. #2162

merged 7 commits into from
Jul 3, 2024

Conversation

athas
Copy link
Member

@athas athas commented Jul 3, 2024

Currently only handles one dimensional arrays, but could be extended. Since this is only useful for generated code, I don't think wider applicability is important.

There is still work to do in the frontend, where some passes (e.g. monomorphisation) do not handle this particularly efficiently. We may want to also add ArrayVal to the frontend language, and desugar to it during full normalisation.

Currently only handles one dimensional arrays, but could be extended.
Since this is only useful for generated code, I don't think wider
applicability is important.

There is still work to do in the frontend, where some passes (e.g.
monomorphisation) do not handle this particularly efficiently. We may
want to also add ArrayVal to the frontend language, and desugar to it
during full normalisation.
@athas
Copy link
Member Author

athas commented Jul 3, 2024

@WilliamDue With this change, futhark cuda --library json.fut takes 14s on my machine (vs 73s before). I think I can still make it a bit faster. Also, this is an OK demonstration of how many places you have to modify the compiler when adding a fundamental new language construct.

@athas
Copy link
Member Author

athas commented Jul 3, 2024

Now down to 9.5s.

@athas
Copy link
Member Author

athas commented Jul 3, 2024

Now 6.1s. Last bottleneck seems to be lexing.

athas added 2 commits July 3, 2024 18:17
This is only used in the (slightly useless) 'futhark tokens' command,
not in the real parser.
@athas athas added the run-benchmarks Makes GA run the benchmark suite. label Jul 3, 2024
@athas athas merged commit 0e13d41 into master Jul 3, 2024
29 of 30 checks passed
@athas athas deleted the arrayval branch July 3, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-benchmarks Makes GA run the benchmark suite.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant