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 a preliminary version of pairwise reduce #38

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

exaexa
Copy link
Member

@exaexa exaexa commented May 19, 2024

this needs some improvement but looks to be the way to reduce a lot of Value's.

@exaexa exaexa marked this pull request as draft May 19, 2024 11:10
@exaexa
Copy link
Member Author

exaexa commented May 19, 2024

cc @stelmo opinions welcome

@exaexa
Copy link
Member Author

exaexa commented May 19, 2024

stupid minibenchmark even with the completely type-broken version:

julia> x = C.LinearValue.(([i] for i=1:1000000),Ref([1]));

julia> @time sum(x)
  9.970770 seconds (10.11 M allocations: 20.243 GiB, 8.99% gc time)
ConstraintTrees.LinearValue([1, 2, 3, 4, 5, 6, 7, 8, 9, 10    999991, 999992, 999993, 999994, 999995, 999996, 999997, 999998, 999999, 1000000], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0    1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])

julia> @time C.preduce(+, x, init=0)
  1.568678 seconds (26.34 M allocations: 1.670 GiB, 6.86% gc time)
ConstraintTrees.LinearValue([1, 2, 3, 4, 5, 6, 7, 8, 9, 10    999991, 999992, 999993, 999994, 999995, 999996, 999997, 999998, 999999, 1000000], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0    1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])

@exaexa
Copy link
Member Author

exaexa commented Jun 5, 2024

ok good I de-haskellized this and

julia> @time C.preduce(+,x)
  0.632748 seconds (4.34 M allocations: 916.133 MiB, 6.17% gc time)

I'll merge this into the other perf-related MR to simplify testing

@exaexa exaexa changed the base branch from master to mk-sizehints June 5, 2024 18:36
@exaexa exaexa marked this pull request as ready for review June 5, 2024 18:36
@exaexa exaexa merged commit 64d52d0 into mk-sizehints Jun 5, 2024
3 checks passed
@exaexa exaexa added this to the v1.1 milestone Jun 6, 2024
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