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

Workaround subarray test failure due to associativity. #29386

Merged
merged 1 commit into from
Oct 15, 2018
Merged

Workaround subarray test failure due to associativity. #29386

merged 1 commit into from
Oct 15, 2018

Conversation

cdluminate
Copy link
Contributor

@cdluminate cdluminate commented Sep 27, 2018

The failure was spotted on Ubuntu builds.

subarray: Test Failed at /usr/share/julia/test/subarray.jl:611
  Expression: #= /usr/share/julia/test/subarray.jl:611 =# @inferred(sum(Base.unaliascopy(V))) == sum(V) == sum(A[2:5, :, 2:5, 1:2:5])
   Evaluated: 121.8579669083425 == 121.8579669083425 == 121.85796690834263
A = rand(5,5,5,5)
V = view(A, 2:5, :, 2:5, 1:2:5)
@code_typed sum(V)  # calls mapfoldl
@code_typed sum(A[2:5, :, 2:5, 1:2:5])  # calls mapreduce

mapreduce doesn't guarantee the associativity, which is likely
the cause of this precision issue spotted in the sum of random numbers.

@ginggs

| subarray: Test Failed at /usr/share/julia/test/subarray.jl:611
|  Expression: #= /usr/share/julia/test/subarray.jl:611 =# @inferred(sum(Base.unaliascopy(V))) == sum(V) == sum(A[2:5, :, 2:5, 1:2:5])
|   Evaluated: 121.8579669083425 == 121.8579669083425 == 121.85796690834263

A = rand(5,5,5,5)
V = view(A, 2:5, :, 2:5, 1:2:5)
@code_typed sum(V)  # calls mapfoldl
@code_typed sum(A[2:5, :, 2:5, 1:2:5])  # calls mapreduce

mapreduce doesn't guarantee the associativity, which is likely
the cause of this precision issue in random sum.
@fredrikekre fredrikekre added the arrays [a, r, r, a, y, s] label Sep 27, 2018
@fredrikekre fredrikekre requested a review from mbauman September 27, 2018 08:40
@mbauman
Copy link
Member

mbauman commented Oct 15, 2018

Thanks!

@mbauman mbauman merged commit 518f548 into JuliaLang:master Oct 15, 2018
KristofferC pushed a commit that referenced this pull request Oct 19, 2018
| subarray: Test Failed at /usr/share/julia/test/subarray.jl:611
|  Expression: #= /usr/share/julia/test/subarray.jl:611 =# @inferred(sum(Base.unaliascopy(V))) == sum(V) == sum(A[2:5, :, 2:5, 1:2:5])
|   Evaluated: 121.8579669083425 == 121.8579669083425 == 121.85796690834263

A = rand(5,5,5,5)
V = view(A, 2:5, :, 2:5, 1:2:5)
@code_typed sum(V)  # calls mapfoldl
@code_typed sum(A[2:5, :, 2:5, 1:2:5])  # calls mapreduce

mapreduce doesn't guarantee the associativity, which is likely
the cause of this precision issue in random sum.

(cherry picked from commit 518f548)
KristofferC pushed a commit that referenced this pull request Feb 11, 2019
| subarray: Test Failed at /usr/share/julia/test/subarray.jl:611
|  Expression: #= /usr/share/julia/test/subarray.jl:611 =# @inferred(sum(Base.unaliascopy(V))) == sum(V) == sum(A[2:5, :, 2:5, 1:2:5])
|   Evaluated: 121.8579669083425 == 121.8579669083425 == 121.85796690834263

A = rand(5,5,5,5)
V = view(A, 2:5, :, 2:5, 1:2:5)
@code_typed sum(V)  # calls mapfoldl
@code_typed sum(A[2:5, :, 2:5, 1:2:5])  # calls mapreduce

mapreduce doesn't guarantee the associativity, which is likely
the cause of this precision issue in random sum.

(cherry picked from commit 518f548)
KristofferC pushed a commit that referenced this pull request Feb 20, 2020
| subarray: Test Failed at /usr/share/julia/test/subarray.jl:611
|  Expression: #= /usr/share/julia/test/subarray.jl:611 =# @inferred(sum(Base.unaliascopy(V))) == sum(V) == sum(A[2:5, :, 2:5, 1:2:5])
|   Evaluated: 121.8579669083425 == 121.8579669083425 == 121.85796690834263

A = rand(5,5,5,5)
V = view(A, 2:5, :, 2:5, 1:2:5)
@code_typed sum(V)  # calls mapfoldl
@code_typed sum(A[2:5, :, 2:5, 1:2:5])  # calls mapreduce

mapreduce doesn't guarantee the associativity, which is likely
the cause of this precision issue in random sum.

(cherry picked from commit 518f548)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants