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

Store transposed transition matrix to speed up forward #107

Closed
wants to merge 4 commits into from

Conversation

gdalle
Copy link
Owner

@gdalle gdalle commented Sep 28, 2024

Fix #106 by storing a copy of the transposed transition matrix (and its elementwise logs) inside the concrete HMM type. To remain generic, I add methods for AbstractHMM that fall back on transpose.

@gdalle gdalle added the run benchmark Benchmarks are run by CI label Sep 28, 2024
Copy link

Benchmark result

Judge result

Benchmark Report for /home/runner/work/HiddenMarkovModels.jl/HiddenMarkovModels.jl

Job Properties

  • Time of benchmarks:
    • Target: 28 Sep 2024 - 07:16
    • Baseline: 28 Sep 2024 - 07:20
  • Package commits:
    • Target: 2a4ba5
    • Baseline: a8b048
  • Julia commits:
    • Target: 6f3fdf
    • Baseline: 6f3fdf
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: OPENBLAS_NUM_THREADS => 1 JULIA_NUM_THREADS => auto
    • Baseline: OPENBLAS_NUM_THREADS => 1 JULIA_NUM_THREADS => auto

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 0.75 (5%) ✅ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 1.12 (5%) ❌ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 1.35 (5%) ❌ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 0.80 (5%) ✅ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 0.94 (5%) ✅ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 0.95 (5%) ✅ 1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]

Julia versioninfo

Target

Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.5 LTS
  uname: Linux 6.8.0-1014-azure #16~22.04.1-Ubuntu SMP Thu Aug 15 21:31:41 UTC 2024 x86_64 x86_64
  CPU: AMD EPYC 7763 64-Core Processor: 
              speed         user         nice          sys         idle          irq
       #1  2445 MHz       1178 s          0 s        108 s       3200 s          0 s
       #2  3243 MHz       1168 s          0 s        102 s       3221 s          0 s
       #3  3236 MHz       1163 s          0 s         94 s       3241 s          0 s
       #4  3249 MHz       1138 s          0 s        113 s       3227 s          0 s
  Memory: 15.615272521972656 GB (13463.203125 MB free)
  Uptime: 452.51 sec
  Load Avg:  1.84  1.13  0.49
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)

Baseline

Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.5 LTS
  uname: Linux 6.8.0-1014-azure #16~22.04.1-Ubuntu SMP Thu Aug 15 21:31:41 UTC 2024 x86_64 x86_64
  CPU: AMD EPYC 7763 64-Core Processor: 
              speed         user         nice          sys         idle          irq
       #1  3247 MHz       2003 s          0 s        143 s       4442 s          0 s
       #2  3246 MHz       1987 s          0 s        137 s       4470 s          0 s
       #3  3176 MHz       1848 s          0 s        134 s       4618 s          0 s
       #4  2636 MHz       1695 s          0 s        145 s       4741 s          0 s
  Memory: 15.615272521972656 GB (13445.04296875 MB free)
  Uptime: 663.19 sec
  Load Avg:  2.06  1.38  0.72
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)

Target result

Benchmark Report for /home/runner/work/HiddenMarkovModels.jl/HiddenMarkovModels.jl

Job Properties

  • Time of benchmark: 28 Sep 2024 - 7:16
  • Package commit: 2a4ba5
  • Julia commit: 6f3fdf
  • Julia command flags: None
  • Environment variables: OPENBLAS_NUM_THREADS => 1 JULIA_NUM_THREADS => auto

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 2.323 ms (5%) 5.42 MiB (1%) 2070
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 315.009 μs (5%) 518.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 417.100 μs (5%) 1.26 MiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 432.138 μs (5%) 768.69 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 4.016 ms (5%) 18.39 MiB (1%) 2070
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 714.487 μs (5%) 1018.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 761.635 μs (5%) 2.48 MiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 1.260 ms (5%) 1.48 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 390.471 μs (5%) 726.25 KiB (1%) 2070
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 132.938 μs (5%) 143.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 205.434 μs (5%) 347.34 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 104.005 μs (5%) 206.19 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 1.252 ms (5%) 2.42 MiB (1%) 10119
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 899.393 μs (5%) 1.24 MiB (1%) 8028
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 583.602 μs (5%) 1.44 MiB (1%) 8036
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 627.164 μs (5%) 1.30 MiB (1%) 8030
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "baum_welch"] 553.305 μs (5%) 729.09 KiB (1%) 2095
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "forward"] 171.641 μs (5%) 143.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "forward_backward"] 247.133 μs (5%) 347.34 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "viterbi"] 143.559 μs (5%) 206.19 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 6.660 ms (5%) 67.67 MiB (1%) 4075
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 1.188 ms (5%) 1.97 MiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 1.708 ms (5%) 4.95 MiB (1%) 36
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 3.997 ms (5%) 2.95 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "baum_welch"] 4.590 ms (5%) 15.67 MiB (1%) 16051
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "forward"] 992.587 μs (5%) 2.06 MiB (1%) 2007
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "forward_backward"] 1.284 ms (5%) 5.16 MiB (1%) 3998
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "viterbi"] 1.038 ms (5%) 2.95 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 531.124 μs (5%) 1.75 MiB (1%) 2070
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 187.201 μs (5%) 268.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 271.198 μs (5%) 660.22 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 188.142 μs (5%) 393.69 KiB (1%) 29

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]

Julia versioninfo

Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.5 LTS
  uname: Linux 6.8.0-1014-azure #16~22.04.1-Ubuntu SMP Thu Aug 15 21:31:41 UTC 2024 x86_64 x86_64
  CPU: AMD EPYC 7763 64-Core Processor: 
              speed         user         nice          sys         idle          irq
       #1  2445 MHz       1178 s          0 s        108 s       3200 s          0 s
       #2  3243 MHz       1168 s          0 s        102 s       3221 s          0 s
       #3  3236 MHz       1163 s          0 s         94 s       3241 s          0 s
       #4  3249 MHz       1138 s          0 s        113 s       3227 s          0 s
  Memory: 15.615272521972656 GB (13463.203125 MB free)
  Uptime: 452.51 sec
  Load Avg:  1.84  1.13  0.49
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)

Baseline result

Benchmark Report for /home/runner/work/HiddenMarkovModels.jl/HiddenMarkovModels.jl

Job Properties

  • Time of benchmark: 28 Sep 2024 - 7:20
  • Package commit: a8b048
  • Julia commit: 6f3fdf
  • Julia command flags: None
  • Environment variables: OPENBLAS_NUM_THREADS => 1 JULIA_NUM_THREADS => auto

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 2.365 ms (5%) 5.41 MiB (1%) 2068
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 317.444 μs (5%) 518.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 423.251 μs (5%) 1.26 MiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 434.493 μs (5%) 768.62 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 5.373 ms (5%) 18.37 MiB (1%) 2068
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 700.971 μs (5%) 1018.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 761.244 μs (5%) 2.48 MiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 1.285 ms (5%) 1.48 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 397.313 μs (5%) 725.77 KiB (1%) 2068
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 138.560 μs (5%) 143.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 212.307 μs (5%) 347.28 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 105.818 μs (5%) 206.12 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 1.113 ms (5%) 2.42 MiB (1%) 10117
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 667.959 μs (5%) 1.24 MiB (1%) 8028
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 589.182 μs (5%) 1.44 MiB (1%) 8036
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 627.644 μs (5%) 1.30 MiB (1%) 8030
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "baum_welch"] 547.684 μs (5%) 728.61 KiB (1%) 2093
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "forward"] 176.971 μs (5%) 143.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "forward_backward"] 250.678 μs (5%) 347.28 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "viterbi"] 141.084 μs (5%) 206.12 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 6.549 ms (5%) 67.61 MiB (1%) 4071
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 1.159 ms (5%) 1.97 MiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 1.693 ms (5%) 4.95 MiB (1%) 36
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 4.056 ms (5%) 2.95 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "baum_welch"] 4.783 ms (5%) 15.67 MiB (1%) 16039
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "forward"] 1.002 ms (5%) 2.06 MiB (1%) 2007
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "forward_backward"] 1.313 ms (5%) 5.16 MiB (1%) 3998
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "viterbi"] 1.033 ms (5%) 2.95 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 662.790 μs (5%) 1.75 MiB (1%) 2068
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 198.711 μs (5%) 268.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 285.615 μs (5%) 660.16 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 190.997 μs (5%) 393.62 KiB (1%) 29

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]

Julia versioninfo

Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.5 LTS
  uname: Linux 6.8.0-1014-azure #16~22.04.1-Ubuntu SMP Thu Aug 15 21:31:41 UTC 2024 x86_64 x86_64
  CPU: AMD EPYC 7763 64-Core Processor: 
              speed         user         nice          sys         idle          irq
       #1  3247 MHz       2003 s          0 s        143 s       4442 s          0 s
       #2  3246 MHz       1987 s          0 s        137 s       4470 s          0 s
       #3  3176 MHz       1848 s          0 s        134 s       4618 s          0 s
       #4  2636 MHz       1695 s          0 s        145 s       4741 s          0 s
  Memory: 15.615272521972656 GB (13445.04296875 MB free)
  Uptime: 663.19 sec
  Load Avg:  2.06  1.38  0.72
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)

Runtime information

Runtime Info
BLAS #threads 2
BLAS.vendor() lbt
Sys.CPU_THREADS 4

lscpu output:

Architecture:                         x86_64
CPU op-mode(s):                       32-bit, 64-bit
Address sizes:                        48 bits physical, 48 bits virtual
Byte Order:                           Little Endian
CPU(s):                               4
On-line CPU(s) list:                  0-3
Vendor ID:                            AuthenticAMD
Model name:                           AMD EPYC 7763 64-Core Processor
CPU family:                           25
Model:                                1
Thread(s) per core:                   2
Core(s) per socket:                   2
Socket(s):                            1
Stepping:                             1
BogoMIPS:                             4890.86
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves user_shstk clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
Virtualization:                       AMD-V
Hypervisor vendor:                    Microsoft
Virtualization type:                  full
L1d cache:                            64 KiB (2 instances)
L1i cache:                            64 KiB (2 instances)
L2 cache:                             1 MiB (2 instances)
L3 cache:                             32 MiB (1 instance)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-3
Vulnerability Gather data sampling:   Not affected
Vulnerability Itlb multihit:          Not affected
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Vulnerable: Safe RET, no microcode
Vulnerability Spec store bypass:      Vulnerable
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Retpolines; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected
Cpu Property Value
Brand AMD EPYC 7763 64-Core Processor
Vendor :AMD
Architecture :Unknown
Model Family: 0xaf, Model: 0x01, Stepping: 0x01, Type: 0x00
Cores 16 physical cores, 16 logical cores (on executing CPU)
No Hyperthreading hardware capability detected
Clock Frequencies Not supported by CPU
Data Cache Level 1:3 : (32, 512, 32768) kbytes
64 byte cache line size
Address Size 48 bits virtual, 48 bits physical
SIMD 256 bit = 32 byte max. SIMD vector size
Time Stamp Counter TSC is accessible via rdtsc
TSC runs at constant rate (invariant from clock frequency)
Perf. Monitoring Performance Monitoring Counters (PMC) are not supported
Hypervisor Yes, Microsoft

@gdalle
Copy link
Owner Author

gdalle commented Sep 28, 2024

@THargreaves this seems to worsen performance for very small state spaces, any idea why?

Copy link

Benchmark result

Judge result

Benchmark Report for /home/runner/work/HiddenMarkovModels.jl/HiddenMarkovModels.jl

Job Properties

  • Time of benchmarks:
    • Target: 28 Sep 2024 - 07:33
    • Baseline: 28 Sep 2024 - 07:36
  • Package commits:
    • Target: 101ff2
    • Baseline: a8b048
  • Julia commits:
    • Target: 6f3fdf
    • Baseline: 6f3fdf
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: OPENBLAS_NUM_THREADS => 1 JULIA_NUM_THREADS => auto
    • Baseline: OPENBLAS_NUM_THREADS => 1 JULIA_NUM_THREADS => auto

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 0.86 (5%) ✅ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 0.95 (5%) ✅ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 0.74 (5%) ✅ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 0.75 (5%) ✅ 1.00 (1%)
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 0.94 (5%) ✅ 1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]

Julia versioninfo

Target

Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.5 LTS
  uname: Linux 6.8.0-1014-azure #16~22.04.1-Ubuntu SMP Thu Aug 15 21:31:41 UTC 2024 x86_64 x86_64
  CPU: AMD EPYC 7763 64-Core Processor: 
              speed         user         nice          sys         idle          irq
       #1  2728 MHz       1134 s          0 s        100 s       2529 s          0 s
       #2  2445 MHz       1384 s          0 s        112 s       2271 s          0 s
       #3  3237 MHz       1164 s          0 s         86 s       2515 s          0 s
       #4  3240 MHz        908 s          0 s        110 s       2726 s          0 s
  Memory: 15.61526870727539 GB (13362.03125 MB free)
  Uptime: 379.23 sec
  Load Avg:  1.96  1.16  0.5
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)

Baseline

Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.5 LTS
  uname: Linux 6.8.0-1014-azure #16~22.04.1-Ubuntu SMP Thu Aug 15 21:31:41 UTC 2024 x86_64 x86_64
  CPU: AMD EPYC 7763 64-Core Processor: 
              speed         user         nice          sys         idle          irq
       #1  2627 MHz       1896 s          0 s        131 s       3760 s          0 s
       #2  2445 MHz       1847 s          0 s        144 s       3800 s          0 s
       #3  3226 MHz       1990 s          0 s        118 s       3681 s          0 s
       #4  3242 MHz       1638 s          0 s        136 s       3994 s          0 s
  Memory: 15.61526870727539 GB (13413.76171875 MB free)
  Uptime: 582.01 sec
  Load Avg:  1.55  1.28  0.68
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)

Target result

Benchmark Report for /home/runner/work/HiddenMarkovModels.jl/HiddenMarkovModels.jl

Job Properties

  • Time of benchmark: 28 Sep 2024 - 7:33
  • Package commit: 101ff2
  • Julia commit: 6f3fdf
  • Julia command flags: None
  • Environment variables: OPENBLAS_NUM_THREADS => 1 JULIA_NUM_THREADS => auto

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 2.303 ms (5%) 5.42 MiB (1%) 2070
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 322.985 μs (5%) 518.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 426.068 μs (5%) 1.26 MiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 436.478 μs (5%) 768.69 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 5.519 ms (5%) 18.39 MiB (1%) 2070
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 667.771 μs (5%) 1018.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 757.068 μs (5%) 2.48 MiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 1.299 ms (5%) 1.48 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 399.168 μs (5%) 726.25 KiB (1%) 2070
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 139.271 μs (5%) 143.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 213.259 μs (5%) 347.34 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 105.077 μs (5%) 206.19 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 943.659 μs (5%) 2.42 MiB (1%) 10119
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 512.420 μs (5%) 1.24 MiB (1%) 8028
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 588.433 μs (5%) 1.44 MiB (1%) 8036
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 470.631 μs (5%) 1.30 MiB (1%) 8030
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "baum_welch"] 545.502 μs (5%) 729.09 KiB (1%) 2095
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "forward"] 176.130 μs (5%) 143.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "forward_backward"] 247.544 μs (5%) 347.34 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "viterbi"] 141.115 μs (5%) 206.19 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 6.623 ms (5%) 67.67 MiB (1%) 4075
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 1.170 ms (5%) 1.97 MiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 1.696 ms (5%) 4.95 MiB (1%) 36
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 4.168 ms (5%) 2.95 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "baum_welch"] 4.695 ms (5%) 15.67 MiB (1%) 16051
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "forward"] 996.517 μs (5%) 2.06 MiB (1%) 2007
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "forward_backward"] 1.317 ms (5%) 5.16 MiB (1%) 3998
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "viterbi"] 1.044 ms (5%) 2.95 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 524.072 μs (5%) 1.75 MiB (1%) 2070
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 198.722 μs (5%) 268.58 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 282.008 μs (5%) 660.22 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 188.122 μs (5%) 393.69 KiB (1%) 29

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]

Julia versioninfo

Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.5 LTS
  uname: Linux 6.8.0-1014-azure #16~22.04.1-Ubuntu SMP Thu Aug 15 21:31:41 UTC 2024 x86_64 x86_64
  CPU: AMD EPYC 7763 64-Core Processor: 
              speed         user         nice          sys         idle          irq
       #1  2728 MHz       1134 s          0 s        100 s       2529 s          0 s
       #2  2445 MHz       1384 s          0 s        112 s       2271 s          0 s
       #3  3237 MHz       1164 s          0 s         86 s       2515 s          0 s
       #4  3240 MHz        908 s          0 s        110 s       2726 s          0 s
  Memory: 15.61526870727539 GB (13362.03125 MB free)
  Uptime: 379.23 sec
  Load Avg:  1.96  1.16  0.5
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)

Baseline result

Benchmark Report for /home/runner/work/HiddenMarkovModels.jl/HiddenMarkovModels.jl

Job Properties

  • Time of benchmark: 28 Sep 2024 - 7:36
  • Package commit: a8b048
  • Julia commit: 6f3fdf
  • Julia command flags: None
  • Environment variables: OPENBLAS_NUM_THREADS => 1 JULIA_NUM_THREADS => auto

Results

Below is a table of this job's results, obtained by running the benchmarks.
The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to
index into the BaseBenchmarks suite to retrieve the corresponding benchmarks.
The percentages accompanying time and memory values in the below table are noise tolerances. The "true"
time/memory value for a given benchmark is expected to fall within this percentage of the reported value.
An empty cell means that the value was zero.

ID time GC time memory allocations
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 2.353 ms (5%) 5.41 MiB (1%) 2068
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 316.944 μs (5%) 518.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 419.546 μs (5%) 1.26 MiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 443.581 μs (5%) 768.62 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 6.448 ms (5%) 18.37 MiB (1%) 2068
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 704.871 μs (5%) 1018.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 761.396 μs (5%) 2.48 MiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 1.297 ms (5%) 1.48 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 395.611 μs (5%) 725.77 KiB (1%) 2068
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 139.250 μs (5%) 143.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 212.358 μs (5%) 347.28 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 104.616 μs (5%) 206.12 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 1.267 ms (5%) 2.42 MiB (1%) 10117
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 519.884 μs (5%) 1.24 MiB (1%) 8028
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 591.939 μs (5%) 1.44 MiB (1%) 8036
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 629.079 μs (5%) 1.30 MiB (1%) 8030
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "baum_welch"] 548.267 μs (5%) 728.61 KiB (1%) 2093
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "forward"] 176.510 μs (5%) 143.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "forward_backward"] 250.119 μs (5%) 347.28 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1", "viterbi"] 143.058 μs (5%) 206.12 KiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 7.052 ms (5%) 67.61 MiB (1%) 4071
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 1.158 ms (5%) 1.97 MiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 1.701 ms (5%) 4.95 MiB (1%) 36
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 4.166 ms (5%) 2.95 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "baum_welch"] 4.698 ms (5%) 15.67 MiB (1%) 16039
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "forward"] 991.518 μs (5%) 2.06 MiB (1%) 2007
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "forward_backward"] 1.327 ms (5%) 5.16 MiB (1%) 3998
["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0", "viterbi"] 1.037 ms (5%) 2.95 MiB (1%) 29
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "baum_welch"] 541.264 μs (5%) 1.75 MiB (1%) 2068
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward"] 197.430 μs (5%) 268.52 KiB (1%) 27
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "forward_backward"] 278.852 μs (5%) 660.16 KiB (1%) 35
["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0", "viterbi"] 193.042 μs (5%) 393.62 KiB (1%) 29

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["HiddenMarkovModels.jl", "nb_states 16 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 32 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 4 obs_dim 10 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 1"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 64 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 1 custom_dist 0"]
  • ["HiddenMarkovModels.jl", "nb_states 8 obs_dim 1 seq_length 100 nb_seqs 20 bw_iter 1 sparse 0 custom_dist 0"]

Julia versioninfo

Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
      Ubuntu 22.04.5 LTS
  uname: Linux 6.8.0-1014-azure #16~22.04.1-Ubuntu SMP Thu Aug 15 21:31:41 UTC 2024 x86_64 x86_64
  CPU: AMD EPYC 7763 64-Core Processor: 
              speed         user         nice          sys         idle          irq
       #1  2627 MHz       1896 s          0 s        131 s       3760 s          0 s
       #2  2445 MHz       1847 s          0 s        144 s       3800 s          0 s
       #3  3226 MHz       1990 s          0 s        118 s       3681 s          0 s
       #4  3242 MHz       1638 s          0 s        136 s       3994 s          0 s
  Memory: 15.61526870727539 GB (13413.76171875 MB free)
  Uptime: 582.01 sec
  Load Avg:  1.55  1.28  0.68
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)

Runtime information

Runtime Info
BLAS #threads 2
BLAS.vendor() lbt
Sys.CPU_THREADS 4

lscpu output:

Architecture:                         x86_64
CPU op-mode(s):                       32-bit, 64-bit
Address sizes:                        48 bits physical, 48 bits virtual
Byte Order:                           Little Endian
CPU(s):                               4
On-line CPU(s) list:                  0-3
Vendor ID:                            AuthenticAMD
Model name:                           AMD EPYC 7763 64-Core Processor
CPU family:                           25
Model:                                1
Thread(s) per core:                   2
Core(s) per socket:                   2
Socket(s):                            1
Stepping:                             1
BogoMIPS:                             4890.85
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves user_shstk clzero xsaveerptr rdpru arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
Virtualization:                       AMD-V
Hypervisor vendor:                    Microsoft
Virtualization type:                  full
L1d cache:                            64 KiB (2 instances)
L1i cache:                            64 KiB (2 instances)
L2 cache:                             1 MiB (2 instances)
L3 cache:                             32 MiB (1 instance)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-3
Vulnerability Gather data sampling:   Not affected
Vulnerability Itlb multihit:          Not affected
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Vulnerable: Safe RET, no microcode
Vulnerability Spec store bypass:      Vulnerable
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Retpolines; STIBP disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected
Cpu Property Value
Brand AMD EPYC 7763 64-Core Processor
Vendor :AMD
Architecture :Unknown
Model Family: 0xaf, Model: 0x01, Stepping: 0x01, Type: 0x00
Cores 16 physical cores, 16 logical cores (on executing CPU)
No Hyperthreading hardware capability detected
Clock Frequencies Not supported by CPU
Data Cache Level 1:3 : (32, 512, 32768) kbytes
64 byte cache line size
Address Size 48 bits virtual, 48 bits physical
SIMD 256 bit = 32 byte max. SIMD vector size
Time Stamp Counter TSC is accessible via rdtsc
TSC runs at constant rate (invariant from clock frequency)
Perf. Monitoring Performance Monitoring Counters (PMC) are not supported
Hypervisor Yes, Microsoft

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

Attention: Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.

Project coverage is 90.07%. Comparing base (a8b048a) to head (af9a64f).

Files with missing lines Patch % Lines
src/types/abstract_hmm.jl 42.85% 4 Missing ⚠️
src/types/hmm.jl 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
- Coverage   91.00%   90.07%   -0.93%     
==========================================
  Files          17       17              
  Lines         489      504      +15     
==========================================
+ Hits          445      454       +9     
- Misses         44       50       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle gdalle removed the run benchmark Benchmarks are run by CI label Sep 28, 2024
@gdalle
Copy link
Owner Author

gdalle commented Sep 28, 2024

Oh well, maybe the CI benchmarks are just very noisy

@THargreaves
Copy link
Contributor

Hmm that's peculiar. I can understand why it might not have a speed boost for small matrices but a regression surprises me.

@gdalle
Copy link
Owner Author

gdalle commented Sep 28, 2024

I think it was a benchmarking artefact. But I'm actually also surprised about the speed boost: for matrix-vector products, isnt't it just as efficient to store the matrix in column-major (Matrix) or row-major (transpose(::Matrix)) format? Why do we get a speedup at all?

@THargreaves
Copy link
Contributor

I'm starting to wonder if the whole thing was just a benchmarking artefact.

I initially decided to test this because I'd had experiences with CUDA.jl where setting the transpose flag for the input matrix led to much slower computations. I made a change similar to yours and the benchmark results looked quite consistent but could just have been noise/specific to my hardware.

Interestingly though, testing this directly with x=rand(10, 10), y=rand(10) suggests that the transposed multiplication is actually faster:

julia> @benchmark $x * $y
BenchmarkTools.Trial: 10000 samples with 932 evaluations.
 Range (min  max):  108.235 ns   75.204 μs  ┊ GC (min  max): 0.00%  99.83%
 Time  (median):     115.343 ns               ┊ GC (median):    0.00%
 Time  (mean ± σ):   122.019 ns ± 750.931 ns  ┊ GC (mean ± σ):  6.32% ±  2.23%

      ▁█▃              ▂▁                                        
  ▁▁▂▃███▅▂▁▁▂▂▂▁▁▁▁▃▅███▆▄▃▂▃▃▂▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂
  108 ns           Histogram: frequency by time          131 ns <

 Memory estimate: 144 bytes, allocs estimate: 1.

julia> @benchmark $(transpose(x)) * $y
BenchmarkTools.Trial: 10000 samples with 985 evaluations.
 Range (min  max):  57.318 ns   75.435 μs  ┊ GC (min  max):  0.00%  99.90%
 Time  (median):     63.155 ns               ┊ GC (median):     0.00%
 Time  (mean ± σ):   70.518 ns ± 753.754 ns  ┊ GC (mean ± σ):  11.00% ±  2.73%

       ▅█          ▁                                            
  ▁▁▄▅▅███▃▁▁▁▁▁▂▄▄██▆▇▅▄▄▃▃▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂
  57.3 ns         Histogram: frequency by time         79.5 ns <

 Memory estimate: 144 bytes, allocs estimate: 1.

julia> @benchmark transpose($x) * $y
BenchmarkTools.Trial: 10000 samples with 984 evaluations.
 Range (min  max):  57.333 ns   71.357 μs  ┊ GC (min  max):  0.00%  99.88%
 Time  (median):     63.051 ns               ┊ GC (median):     0.00%
 Time  (mean ± σ):   69.734 ns ± 712.979 ns  ┊ GC (mean ± σ):  10.53% ±  2.72%

         ▃█▆                ▃▂                                  
  ▁▁▃▅▅▄▅████▅▃▂▁▁▁▁▁▁▁▁▂▄▅▆██▇▆▅▄▃▄▄▃▃▃▃▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂
  57.3 ns         Histogram: frequency by time         72.2 ns <

 Memory estimate: 144 bytes, allocs estimate: 1.

@gdalle
Copy link
Owner Author

gdalle commented Sep 28, 2024

In light of these findings, I suggest we deep the results inconclusive enough to give up on this tweak for now?

@THargreaves
Copy link
Contributor

Certainly, agreed.

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.

Avoid repeated transposition when using time-homogenous transition matrix
2 participants