The example in the README is confusing
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- julia
- Lĩnh vực
- documentation
Hướng nghiên cứu
Trước tiên, hãy xem xét ví dụ trong README cùng với thiết lập và đầu ra BenchmarkTools đã được báo cáo. Sửa các chú thích gây hiểu lầm về các đối số và việc cấp phát, đảm bảo phép so sánh ma trận đối xứng là chính xác, đồng thời ghi lại các đối số và hành vi biến đổi của ArrayLayouts.muladd! được sử dụng trong ví dụ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The README shows the following example:
julia> using ArrayLayouts
julia> A = randn(10_000,10_000); x = randn(10_000); y = similar(x);
julia> V = view(Symmetric(A),:,:)';
julia> @time mul!(y, A, x); # Julia does not recognize that V is symmetric
0.040255 seconds (4 allocations: 160 bytes)
julia> @time muladd!(1.0, V, x, 0.0, y); # ArrayLayouts does and is 3x faster as it calls BLAS
0.017677 seconds (4 allocations: 160 bytes)
Specifically this line:
julia> @time mul!(y, A, x); # Julia does not recognize that V is symmetric
The argument A is used instead of V, so the comment is irrelevant, Julia cannot figure out that the matrix is symmetric, because A matrix is not really symmetric. Also both function should not allocate anything, the reported allocations are possible due to use of global variables in the REPL.
Here is an updated benchmark (with BenchmarkTools), which does not really show any difference if V argument is used instead and without global variables. At least on my computer.
@benchmark LinearAlgebra.mul!(y, V, x) setup = begin
rng = StableRNG(123)
y = randn(rng, 10_000)
x = randn(rng, 10_000)
L = randn(rng, 10_000, 10_000)
A = L * L' + I(10_000) # Make an actual symmetric matrix
V = Symmetric(A)
end
@benchmark ArrayLayouts.muladd!(1.0, V, x, 0.0, y) setup = begin
rng = StableRNG(123)
y = randn(rng, 10_000)
x = randn(rng, 10_000)
L = randn(rng, 10_000, 10_000)
A = L * L' + I(10_000) # Make an actual symmetric matrix
V = Symmetric(A)
end
with the output
BenchmarkTools.Trial: 2 samples with 1 evaluation.
Range (min … max): 9.245 ms … 9.855 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 9.550 ms ┊ GC (median): 0.00%
Time (mean ± σ): 9.550 ms ± 431.100 μs ┊ GC (mean ± σ): 0.00% ± 0.00%
█ █
█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
9.24 ms Histogram: frequency by time 9.85 ms <
Memory estimate: 0 bytes, allocs estimate: 0.
BenchmarkTools.Trial: 2 samples with 1 evaluation.
Range (min … max): 9.057 ms … 9.130 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 9.093 ms ┊ GC (median): 0.00%
Time (mean ± σ): 9.093 ms ± 51.707 μs ┊ GC (mean ± σ): 0.00% ± 0.00%
█ █
█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
9.06 ms Histogram: frequency by time 9.13 ms <
Memory estimate: 0 bytes, allocs estimate: 0.
A small note to that: there is also no documentation for the muladd! from ArrayLayouts even though it is used as a first example. It's hard to guess what argument stores the result of the operation. I assume the usage of ! means that the function mutates its arguments.
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 10 × Apple M2 Pro
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 2 on 6 virtual cores
Environment:
JULIA_IMAGE_THREADS = 1
- Ngôn ngữ chính
- Julia
- Star
- 57
- Fork
- 10
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của JuliaLinearAlgebra/ArrayLayouts.jl
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
JuliaLinearAlgebra/ArrayLayouts.jl#277 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
JuliaLinearAlgebra/ArrayLayouts.jl#253 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
JuliaLinearAlgebra/ArrayLayouts.jl#243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add RectDiagonalLayoutĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
JuliaLinearAlgebra/ArrayLayouts.jl#185 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
JuliaLinearAlgebra/ArrayLayouts.jl#157 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của JuliaLinearAlgebra/ArrayLayouts.jl
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation invalid
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
JuliaPhysics/BeamletOptics.jl#190 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
mul! with a Symmetric or Hermitian factor throws for a matrix view whose columns are not contiguousCó thể đã có người làm @dkarrasch đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
JuliaLang/LinearAlgebra.jl#1829 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`EnsembleSummary` `ci_type = :SEM` ribbon is `sqrt(N)` too wide for scalar statesCó thể đã có người làm @isaacsas đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
SciML/SciMLBase.jl#1654 ·
Maintainer thường phản hồi trong vòng 3 ngày