-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
adaptive mixed precision #506
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have some inline comments about what is happening here, and what this example does, in common terms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/Dagger.jl
Outdated
@@ -74,7 +74,7 @@ include("array/sort.jl") | |||
include("array/linalg.jl") | |||
include("array/mul.jl") | |||
include("array/cholesky.jl") | |||
|
|||
include("array/adaptive_mp.jl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include("array/adaptive_mp.jl") | |
include("array/adaptive_mp.jl") | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this supposed to return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/array/adaptive_mp.jl
Outdated
@@ -0,0 +1,88 @@ | |||
function tile_precision(uplo, global_norm, scalar_factore, tolerance, A) | |||
tile_sqr = 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think A
should be the first argument, since it's the "target" of the operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/array/adaptive_mp.jl
Outdated
return "FP32" | ||
else | ||
return "FP64" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need to be strings, or can we use Float16
, Float32
, etc.? Or alternatively, use Symbol
s instead, like :Float64
, since Float8
doesn't exist in Julia Base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
src/array/adaptive_mp.jl
Outdated
end | ||
|
||
|
||
function adaptive_mp!(A::DArray{T,2}, MP::DArray{String,2}, tolerance::Float64) where T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring for this method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
Adding adaptive mixed precision block-wise based on formula from Mixed precision algorithms in numerical linear algebra