Skip to content
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

Adding the necessary files to benchmark AMD.jl #38

Merged

Conversation

MonssafToukal
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jan 18, 2021

Codecov Report

Merging #38 (36764cb) into master (e8028ce) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #38   +/-   ##
=======================================
  Coverage   95.16%   95.16%           
=======================================
  Files           3        3           
  Lines         124      124           
=======================================
  Hits          118      118           
  Misses          6        6           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8028ce...36764cb. Read the comment docs.

Copy link
Member

@dpo dpo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Here is a first round of comments.

sh 'printenv'
sh '''
git clean -fd
git reset --hard
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line isn't in LDLFactorizations.jl. Should it be added there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It definitely should be added in LDLFactorizations.jl as well!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you submit a PR there please?

benchmark/benchmarks.jl Outdated Show resolved Hide resolved
benchmark/Project.toml Show resolved Hide resolved
benchmark/benchmarks.jl Outdated Show resolved Hide resolved
# push!(ratio_symrcm, nnz(ldlt_symrcm) / nnz_A)
# push!(ratio_classic, nnz(ldlt_classic) / nnz_A)

SUITE["no_ordering"][name] = @benchmarkable collect(1:size($A,1))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you want here is to perform the factorization with ordering 1:n and count the number of nonzero elements in the L factor, and then the ratio nnz(L) / nnz(tril(A, -1)).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean nnz(tril(A)) instead of nnz(tril(A, -1))?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this line used to say nnz(tril(A)) but I think it should be nnz(tril(A, -1)) because we don't store the diagonal of the L factor. So we want to compare the number of nonzeros in L (which is strictly lower triangular) to the number of nonzeros in the strict lower triangle of A.

Copy link
Member

@amontoison amontoison Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A is the matrix that we want to factorize so I suppose that it's relevant to count the nnz elements on its diagonal when A is symmetric.
With the LDL' factorization, L have a unit diagonal so we don't count the ones but we also have the elements of D.
When I did the benchmarks, I used the ratio (nnz(tril(L, -1)) + nnz(D)) / nnz(tril(A)).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D must be full and diag(A) must be full for the factorization to exist. So I think it's sufficient to compare nnz(L) to nnz(tril(A, -1)). The diagonal of L is not stored.

benchmark/benchmarks.jl Outdated Show resolved Hide resolved
# push!(ratio_symrcm, nnz(ldlt_symrcm) / nnz_A)
# push!(ratio_classic, nnz(ldlt_classic) / nnz_A)

SUITE["no_ordering"][name] = @benchmarkable collect(1:size($A,1))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this line used to say nnz(tril(A)) but I think it should be nnz(tril(A, -1)) because we don't store the diagonal of the L factor. So we want to compare the number of nonzeros in L (which is strictly lower triangular) to the number of nonzeros in the strict lower triangle of A.

Copy link
Member

@dpo dpo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there.

@@ -45,37 +43,39 @@ for subdir ∈ subdirs

A = MatrixMarket.mmread(joinpath(iterpath, "K_0.mtx"))
b = readdlm(joinpath(iterpath, "rhs_0.rhs"), Float64)[:]
nnz_A = nnz(tril(A))
nnz_A = nnz(tril(A, -1))
n = size(A,1)
if size(A, 1) ≤ 25000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I erase line 47?

Copy link
Member

@dpo dpo Jan 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I mean to use n instead of size(A, 1) on line 48.

benchmark/benchmarks.jl Outdated Show resolved Hide resolved
benchmark/benchmarks.jl Outdated Show resolved Hide resolved
benchmark/benchmarks.jl Outdated Show resolved Hide resolved
benchmark/benchmarks.jl Outdated Show resolved Hide resolved
@dpo
Copy link
Member

dpo commented Jan 20, 2021

It's looking good now! At this point, the run_benchmarks.jl script is (almost) identical to that in LDLFactorizations.jl, and the send_comment_to_pr.jl and push_benchmarks.sh are identical. Can we think of how to put the common parts in another repo so we don't have to repeat them every time?

@dpo dpo merged commit 6e89524 into JuliaSmoothOptimizers:master Jan 20, 2021
@dpo
Copy link
Member

dpo commented Jan 20, 2021

Thank you @MonssafToukal !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants