Open JinyanTeng opened 1 month ago
When using 30 threads to run the command matmul!(xtx, X', X), I encountered an error. However, when using 20 threads, no error was observed.
How many physical cores does your system have? Octavian should limit itself to that many. For a 24x271 * 271x24 matrix, Octavian will probably only use a single thread, so that's probably a red haring.
__vstore!
showing the problem is a little surprising.
Can you
julia> using Octavian
julia> X = rand(271, 24);
julia> xtxb = fill(-12345.6789, 100, 100);
julia> xtx2 = @view(xtxb[40:63, 40:63]);
julia> Octavian.matmul!(xtx2, X', X);
julia> xtx2 ≈ X' * X
true
julia> all(==(first(xtxb)), @view(xtxb[1:39,:]))
true
julia> all(==(first(xtxb)), @view(xtxb[64:end,:]))
true
julia> all(==(first(xtxb)), @view(xtxb[40:63,1:39]))
true
julia> all(==(first(xtxb)), @view(xtxb[40:63,64:end]))
true
Can you see if any of these checks fail, implying there was an out of bound access?
I tried on both an AVX512 and an AVX2 system, getting all true
on both.
What is your
versioninfo()
?
I suspect the illegal write isn't to xtx
, but to the temporary packed matrix X'
.
What do you get for
julia> Octavian.first_cache_size(Val(eltype(X)))
static(65536)
julia> Octavian.first_cache_size(Val(eltype(X))) / length(X)
10.076260762607626
?
When using 30 threads to run the command matmul!(xtx, X', X), I encountered an error. However, when using 20 threads, no error was observed.
How many physical cores does your system have? Octavian should limit itself to that many. For a 24x271 * 271x24 matrix, Octavian will probably only use a single thread, so that's probably a red haring.
__vstore!
showing the problem is a little surprising.Can you
julia> using Octavian julia> X = rand(271, 24); julia> xtxb = fill(-12345.6789, 100, 100); julia> xtx2 = @view(xtxb[40:63, 40:63]); julia> Octavian.matmul!(xtx2, X', X); julia> xtx2 ≈ X' * X true julia> all(==(first(xtxb)), @view(xtxb[1:39,:])) true julia> all(==(first(xtxb)), @view(xtxb[64:end,:])) true julia> all(==(first(xtxb)), @view(xtxb[40:63,1:39])) true julia> all(==(first(xtxb)), @view(xtxb[40:63,64:end])) true
Can you see if any of these checks fail, implying there was an out of bound access?
I tried on both an AVX512 and an AVX2 system, getting all
true
on both.What is your
versioninfo()
?
FYI.
Do you think you could get an rr trace of the error?
That is, start Julia with --bug-report=rr
and upload the trace?
When using 30 threads to run the command
matmul!(xtx, X', X)
, I encountered an error. However, when using 20 threads, no error was observed. It is important to note that this error is not consistently reproducible and may vary for different matrices X. In this case, the matrix X has dimensions of 271 by 24.ERROR: LoadError: TaskFailedException