Skip to content

Commit 063afa5

Browse files
broader, deeper
1 parent cc094c6 commit 063afa5

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ on:
88

99
jobs:
1010
benchmark:
11-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest]
15+
fail-fast: false
1216
steps:
1317
- name: Checkout repository
1418
uses: actions/checkout@v4
@@ -18,7 +22,8 @@ jobs:
1822
with:
1923
r-version: 'release'
2024

21-
- name: Install system dependencies
25+
- name: Install system dependencies (Linux)
26+
if: runner.os == 'Linux'
2227
run: |
2328
sudo apt-get update
2429
sudo apt-get install -y libopenblas-dev liblapack-dev

inst/benchmarks/benchmark_contention.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ library(Matrix)
33

44
# Generate large random sparse matrix
55
set.seed(42)
6-
n_users = 10000
7-
n_items = 10000
8-
nnz = 200000
6+
n_users = 20000
7+
n_items = 20000
8+
nnz = 1000000
99
I = sample(n_users, nnz, replace = TRUE)
1010
J = sample(n_items, nnz, replace = TRUE)
1111
X = sparseMatrix(i = I, j = J, x = runif(nnz), dims = c(n_users, n_items))
@@ -27,11 +27,11 @@ run_bench = function(use_omp_threads, use_blas_control) {
2727
message(sprintf(" BLAS threads initial: %d", RhpcBLASctl::blas_get_num_procs()))
2828
}
2929

30-
model = WRMF$new(rank = 100, feedback = "implicit", solver = "cholesky")
30+
model = WRMF$new(rank = 120, feedback = "implicit", solver = "cholesky")
3131

3232
start_time = Sys.time()
3333
# Use small number of iterations for quick benchmark
34-
model$fit_transform(X, n_iter = 3L)
34+
model$fit_transform(X, n_iter = 5L)
3535
end_time = Sys.time()
3636

3737
diff_time = as.numeric(end_time - start_time, units = "secs")

0 commit comments

Comments
 (0)