From ba5ec9e09e1bbee3456d79a5de4561dad4772c6a Mon Sep 17 00:00:00 2001 From: antonl Date: Sun, 15 Mar 2026 13:10:47 +0100 Subject: [PATCH] results for go sparse --- goSparseResults.json | 42 +++++++++++++++--------------- src/main.go | 13 +++++++-- suitesparse_test_matrices/urls.txt | 6 ++++- 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/goSparseResults.json b/goSparseResults.json index 0d4d2b2..cf3c76b 100644 --- a/goSparseResults.json +++ b/goSparseResults.json @@ -5,12 +5,12 @@ "cols": 147900, "nnz": 3489300, "matmul_runs": 16, - "matmul_total_ns": 1413419300, - "matmul_avg_ns": 88338706, + "matmul_total_ns": 1416892200, + "matmul_avg_ns": 88555762, "matmul_output_nnz": 14335500, "spmv_runs": 16, - "spmv_total_ns": 21010700, - "spmv_avg_ns": 1313168 + "spmv_total_ns": 21017900, + "spmv_avg_ns": 1313618 }, { "label": "ldoor", @@ -18,12 +18,12 @@ "cols": 952203, "nnz": 23737339, "matmul_runs": 16, - "matmul_total_ns": 6835373200, - "matmul_avg_ns": 427210825, + "matmul_total_ns": 6867829500, + "matmul_avg_ns": 429239343, "matmul_output_nnz": 43783061, "spmv_runs": 16, - "spmv_total_ns": 156246400, - "spmv_avg_ns": 9765400 + "spmv_total_ns": 156089700, + "spmv_avg_ns": 9755606 }, { "label": "Cube_Coup_dt0", @@ -31,24 +31,24 @@ "cols": 2164760, "nnz": 64685452, "matmul_runs": 16, - "matmul_total_ns": 32192429900, - "matmul_avg_ns": 2012026868, + "matmul_total_ns": 31149139200, + "matmul_avg_ns": 1946821200, "matmul_output_nnz": 234465452, "spmv_runs": 16, - "spmv_total_ns": 392950200, - "spmv_avg_ns": 24559387 + "spmv_total_ns": 394415100, + "spmv_avg_ns": 24650943 }, { - "label": "nlpkkt240", - "rows": 27993600, - "cols": 27993600, - "nnz": 401232976, + "label": "nlpkkt200", + "rows": 16240000, + "cols": 16240000, + "nnz": 232232816, "matmul_runs": 16, - "matmul_total_ns": 38319352500, - "matmul_avg_ns": 2394959531, - "matmul_output_nnz": 401232976, + "matmul_total_ns": 19196846100, + "matmul_avg_ns": 1199802881, + "matmul_output_nnz": 232232816, "spmv_runs": 16, - "spmv_total_ns": 3164097400, - "spmv_avg_ns": 197756087 + "spmv_total_ns": 1844563400, + "spmv_avg_ns": 115285212 } ] diff --git a/src/main.go b/src/main.go index f398ff2..30a2385 100644 --- a/src/main.go +++ b/src/main.go @@ -6,6 +6,8 @@ import ( "fmt" "os" "path/filepath" + "runtime" + "runtime/debug" "strconv" "strings" "time" @@ -236,6 +238,8 @@ func doTimings(path string) SparseMatrixTiming { fmt.Printf("Avg SpMV time for %s: %.4f ms\n", bcase.Timing.Label, avgSpMVTimeMS) } + bcase.Matrix = nil // Signal GC that we release this now + return bcase.Timing } @@ -246,13 +250,18 @@ func main() { "suitesparse_test_matrices/FEM_3D_thermal2.mtx", "suitesparse_test_matrices/ldoor.mtx", "suitesparse_test_matrices/Cube_Coup_dt0.mtx", - "suitesparse_test_matrices/nlpkkt240.mtx", + "suitesparse_test_matrices/nlpkkt200.mtx", } results := make([]SparseMatrixTiming, 0, len(paths)) for _, path := range paths { - results = append(results, doTimings(path)) + timing := doTimings(path) + results = append(results, timing) + + // Make sure to free previous matrices to be effective with RAM + runtime.GC() + debug.FreeOSMemory() } writeTimingJSON(results, "goSparseResults.json") diff --git a/suitesparse_test_matrices/urls.txt b/suitesparse_test_matrices/urls.txt index 5171a86..39bec6b 100644 --- a/suitesparse_test_matrices/urls.txt +++ b/suitesparse_test_matrices/urls.txt @@ -10,6 +10,10 @@ https://suitesparse-collection-website.herokuapp.com/MM/GHS_psdef/ldoor.tar.gz # Almost 125M non-zero elements from a structural problem, 420mb compressed, 1.1GB uncompressed .mtx https://suitesparse-collection-website.herokuapp.com/MM/Janna/Cube_Coup_dt0.tar.gz + +# 440M NNZ, should fit in my 32GB ram. 667 mb compressed, 4.7gb uncompressed + + # 760M NNZ, optimization problem 1.23GB compressed, 8.4 GB uncompressed -# This was too large for my 32 GB memory and I went into swap... probably should exclude +# This was too large for my 32 GB memory and I went into swap... probably should exclude because not fair timings... probably will spend majority of time in swap. https://suitesparse-collection-website.herokuapp.com/MM/Schenk/nlpkkt240.tar.gz \ No newline at end of file