Conversation
jpsamaroo
left a comment
There was a problem hiding this comment.
Cool stuff! I'd like some more documentation for this to better understand how this works and how it can be used. An explanation of what tile_precision does would be really helpful
| using KernelFunctions | ||
| using Distances | ||
|
|
||
| k = GammaExponentialKernel(; γ=0.5, metric=Euclidean()); |
There was a problem hiding this comment.
Could we have some inline comments about what is happening here, and what this example does, in common terms?
src/Dagger.jl
Outdated
| include("array/mul.jl") | ||
| include("array/cholesky.jl") | ||
|
|
||
| include("array/adaptive_mp.jl") |
There was a problem hiding this comment.
| include("array/adaptive_mp.jl") | |
| include("array/adaptive_mp.jl") | |
example/mixed_precision.jl
Outdated
| x = randn(4000, 2000); | ||
| A = kernelmatrix(k, x); | ||
| DA = view(A, Blocks(400, 400)); | ||
| MP = fill("FP64", 5, 5); |
There was a problem hiding this comment.
What is this supposed to return?
src/array/adaptive_mp.jl
Outdated
| tile_sqr= mapreduce(LinearAlgebra.norm_sqr, +, LowerTriangular(A)) | ||
| elseif uplo == 'U' | ||
| tile_sqr= mapreduce(LinearAlgebra.norm_sqr, +, UpperTriangular(A)) | ||
| end |
There was a problem hiding this comment.
Are there other kinds of norms that we might want to compute? Maybe instead of hard-coding LowerTriangular, etc., we can let the user provide a function to modify A, or just wrap A before they pass it to tile_precision?
src/array/adaptive_mp.jl
Outdated
| @@ -0,0 +1,88 @@ | |||
| function tile_precision(uplo, global_norm, scalar_factore, tolerance, A) | |||
| tile_sqr = 0.0 | |||
src/array/adaptive_mp.jl
Outdated
| @@ -0,0 +1,88 @@ | |||
| function tile_precision(uplo, global_norm, scalar_factore, tolerance, A) | |||
There was a problem hiding this comment.
| function tile_precision(uplo, global_norm, scalar_factore, tolerance, A) | |
| function tile_precision(uplo, global_norm, scalar_factor, tolerance, A) |
Typo?
There was a problem hiding this comment.
Can you add a docstring to this function that describes what it does and what the parameters are for?
There was a problem hiding this comment.
I think A should be the first argument, since it's the "target" of the operation.
src/array/adaptive_mp.jl
Outdated
| return "FP32" | ||
| else | ||
| return "FP64" | ||
| end |
There was a problem hiding this comment.
Do these need to be strings, or can we use Float16, Float32, etc.? Or alternatively, use Symbols instead, like :Float64, since Float8 doesn't exist in Julia Base.
src/array/adaptive_mp.jl
Outdated
| end | ||
|
|
||
|
|
||
| function adaptive_mp!(A::DArray{T,2}, MP::DArray{String,2}, tolerance::Float64) where T |
Adding adaptive mixed precision block-wise based on formula from Mixed precision algorithms in numerical linear algebra