Announcement

  • More accurate timing by @btime (provided by the BenchmarkTools.jl package):
for r in [10, 20, 30, 40, 50]
    println("r=$r")
    V0 = V0full[:, 1:r]
    W0 = W0full[1:r, :]
    _, _, obj, niter = nnmf(X, r, V = V0, W = W0)
    @btime nnmf($X, $r, V = $V0, W = $W0) setup=(
        copyto!(V0, V0full[:, 1:r]), 
        copyto!(W0, W0full[1:r, :])
        ) evals=1
    println("obj=$obj, niter=$niter")
end

My benchmark results on laptop are

r=10
  355.995 ms (9 allocations: 437.19 KiB)
obj=11730.866905750241, niter=239
r=20
  408.972 ms (9 allocations: 875.44 KiB)
obj=8497.605595865549, niter=394
r=30
  572.517 ms (9 allocations: 1.28 MiB)
obj=6621.945968477521, niter=482
r=40
  607.110 ms (9 allocations: 1.72 MiB)
obj=5256.866299832109, niter=581
r=50
  1.187 s (10 allocations: 2.15 MiB)
obj=4430.362097313249, niter=698
  • GPU. I saw 10x-40x speedup on NVIDIA RTX 2080 Ti GPU.

  • Common issues in HW1: styles, Git, Q3.

  • HW3 posted. Due May 6.