From 5f3ff4ab41dc1f20b0c14edf788210dd0033f5f7 Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Wed, 19 May 2021 12:17:49 -0400 Subject: [PATCH 1/2] modify init_(a/b)cache, don't pack B if there is no bcache --- src/init.jl | 15 ++++++++++----- src/matmul.jl | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/init.jl b/src/init.jl index 0dacfba..8673d3d 100644 --- a/src/init.jl +++ b/src/init.jl @@ -14,14 +14,19 @@ function __init__() end function init_bcache() - BCACHEPTR[] = VectorizationBase.valloc(second_cache_size() * bcache_count(), Cvoid, ccall(:jl_getpagesize, Int, ())) + if bcache_count() ≢ Zero() + BCACHEPTR[] = VectorizationBase.valloc(second_cache_size() * bcache_count(), Cvoid, ccall(:jl_getpagesize, Int, ())) + end nothing end -function init_acache() - Sys.WORD_SIZE ≤ 32 || return - ACACHEPTR[] = VectorizationBase.valloc(first_cache_size() * init_num_tasks(), Cvoid, ccall(:jl_getpagesize, Int, ())) - nothing +if Sys.WORD_SIZE ≤ 32 + function init_acache() + ACACHEPTR[] = VectorizationBase.valloc(first_cache_size() * init_num_tasks(), Cvoid, ccall(:jl_getpagesize, Int, ())) + nothing + end +else + init_acache() = nothing end function init_num_tasks() diff --git a/src/matmul.jl b/src/matmul.jl index f449ee1..e84cb6d 100644 --- a/src/matmul.jl +++ b/src/matmul.jl @@ -355,7 +355,7 @@ function __matmul!( # `nᵣ*nspawn ≥ N` is needed at the moment to avoid accidentally splitting `N` to be `< nᵣ` while packing # Should probably handle that with a smarter splitting function... matmulsplitn!(C, A, B, α, β, Mc, M, K, N, nspawn, Val{false}()) - elseif ((nspawn*(W+W) > M) || (contiguousstride1(B) ? (roundtostaticint(Kc * Nc * R₂Default()) ≥ K * N) : (firstbytestride(B) ≤ 1600))) + elseif (bcache_count() === Zero()) || ((nspawn*(W+W) > M) || (contiguousstride1(B) ? (roundtostaticint(Kc * Nc * R₂Default()) ≥ K * N) : (firstbytestride(B) ≤ 1600))) matmulsplitn!(C, A, B, α, β, Mc, M, K, N, nspawn, Val{true}()) else # TODO: Allow splitting along `N` for `matmul_pack_A_and_B!` matmul_pack_A_and_B!(C, A, B, α, β, M, K, N, nspawn, W₁Default(), W₂Default(), R₁Default(), R₂Default()) From 1590cbca45c6d28ee469b6cca4ac81e7df301aca Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Thu, 20 May 2021 21:58:52 -0400 Subject: [PATCH 2/2] Fix README link. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd3174d..59d3c85 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Environment: JULIA_NUM_THREADS = 36 ``` Resulted in the following: -![octavian10980xebench](https://github.com/JuliaLinearAlgebra/Octavian.jl/tree/master/docs/src/assets/bench10980xe.png) +![octavian10980xebench](https://raw.githubusercontent.com/JuliaLinearAlgebra/Octavian.jl/master/docs/src/assets/bench10980xe.png) ## Related Packages