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

Feature/1263 update stansummary to report rank-normalized ESS tail, ESS bulk, max abs deviation(MAD), and Rhat #1290

Open
wants to merge 78 commits into
base: develop
Choose a base branch
from

Conversation

mitzimorris
Copy link
Member

@mitzimorris mitzimorris commented Aug 5, 2024

Submisison Checklist

  • Run tests: ./runCmdStanTests.py src/test
  • Declare copyright holder and open-source license: see below

Summary:

Update utility stansummary to use stan::mcmc::chainset objects (stan-dev/stan#3313) instead of stan::mcmc::chains. The chainset object provides C++ implementations of split rank-normalized bulk and tail ESS and Rhat, as well as max_abs_deviation, MCSE_mean, and MCSE_sd, all of which have been added to the stansummary report.

Also updated unit tests which use stan::mcmc::chains to use stan::mcmc::chainset instead.

As part of this PR, removed the print utility, which has been advertised as deprecated for a very long time.

Intended Effect:

Improved convergence diagnostics for stansummary, which is used by CmdStanPy and CmdStanR.

How to Verify:

Unit tests

Side Effects:

Output of bin/stansummary will have different set of columns, and slightly different messages.

Documentation:

Separate PR

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Columbia University

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@mitzimorris mitzimorris marked this pull request as draft August 5, 2024 17:23
@mitzimorris
Copy link
Member Author

This PR is a WIP and will fail until Stan PR stan-dev/stan#3305 is merged.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
arma/arma.stan 0.31 0.31 1.01 0.63% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.01 0.01 1.0 -0.15% slower
gp_regr/gen_gp_data.stan 0.02 0.02 1.06 5.23% faster
gp_regr/gp_regr.stan 0.09 0.09 1.03 2.48% faster
sir/sir.stan 65.97 65.91 1.0 0.09% faster
irt_2pl/irt_2pl.stan 3.95 3.95 1.0 0.23% faster
eight_schools/eight_schools.stan 0.06 0.05 1.02 2.3% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.24 0.23 1.01 0.94% faster
pkpd/one_comp_mm_elim_abs.stan 18.69 18.96 0.99 -1.46% slower
garch/garch.stan 0.41 0.41 1.01 0.64% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.62 2.61 1.0 0.37% faster
arK/arK.stan 1.72 1.72 1.0 -0.04% slower
gp_pois_regr/gp_pois_regr.stan 2.75 2.76 1.0 -0.36% slower
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.46 8.45 1.0 0.15% faster
performance.compilation 178.82 177.98 1.0 0.47% faster
Mean result: 1.00798272484638

Jenkins Console Log
Blue Ocean
Commit hash: 2cd95be39b0482d0fedb7fe9a1e8c77b7084592a


Machine information No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
Stepping: 4
CPU MHz: 2400.000
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 1.3 MiB
L1i cache: 1.3 MiB
L2 cache: 40 MiB
L3 cache: 55 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS, IBPB conditional, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities

G++:
g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang:
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

src/cmdstan/stansummary_helper.hpp Outdated Show resolved Hide resolved
src/cmdstan/stansummary_helper.hpp Outdated Show resolved Hide resolved
src/cmdstan/stansummary_helper.hpp Outdated Show resolved Hide resolved
src/test/interface/stansummary_test.cpp Show resolved Hide resolved
@mitzimorris
Copy link
Member Author

changes to stansummary are running afoul of this PR: #972
requires more smarts in stan's stan_csv_reader.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
arma/arma.stan 0.32 0.31 1.05 4.93% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.01 0.01 0.95 -5.02% slower
gp_regr/gen_gp_data.stan 0.03 0.03 0.99 -0.69% slower
gp_regr/gp_regr.stan 0.09 0.1 0.98 -1.62% slower
sir/sir.stan 67.32 67.14 1.0 0.27% faster
irt_2pl/irt_2pl.stan 4.0 3.99 1.0 0.07% faster
eight_schools/eight_schools.stan 0.06 0.06 1.05 4.58% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.25 0.26 0.96 -4.29% slower
pkpd/one_comp_mm_elim_abs.stan 19.09 18.74 1.02 1.8% faster
garch/garch.stan 0.42 0.41 1.03 2.94% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.63 2.61 1.0 0.41% faster
arK/arK.stan 1.74 1.72 1.01 1.09% faster
gp_pois_regr/gp_pois_regr.stan 2.76 2.69 1.02 2.43% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.49 8.49 1.0 -0.0% slower
performance.compilation 192.72 189.73 1.02 1.55% faster
Mean result: 1.0064011728259634

Jenkins Console Log
Blue Ocean
Commit hash: 2c8bf6d3d4fe497e1d8ff310ce5e5f26b1925faa


Machine information No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
Stepping: 4
CPU MHz: 3486.703
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 1.3 MiB
L1i cache: 1.3 MiB
L2 cache: 40 MiB
L3 cache: 55 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities

G++:
g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang:
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
arma/arma.stan 0.36 0.31 1.19 15.73% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.01 0.01 0.99 -1.4% slower
gp_regr/gen_gp_data.stan 0.03 0.03 1.01 0.72% faster
gp_regr/gp_regr.stan 0.09 0.09 1.02 1.75% faster
sir/sir.stan 66.28 66.13 1.0 0.22% faster
irt_2pl/irt_2pl.stan 3.97 3.95 1.01 0.57% faster
eight_schools/eight_schools.stan 0.06 0.05 1.02 1.85% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.24 0.24 0.99 -0.65% slower
pkpd/one_comp_mm_elim_abs.stan 18.69 18.66 1.0 0.17% faster
garch/garch.stan 0.41 0.41 1.01 1.13% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.59 2.6 1.0 -0.2% slower
arK/arK.stan 1.75 1.7 1.03 2.79% faster
gp_pois_regr/gp_pois_regr.stan 2.68 2.67 1.0 0.29% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.4 8.38 1.0 0.3% faster
performance.compilation 176.72 176.91 1.0 -0.11% slower
Mean result: 1.0175108841935923

Jenkins Console Log
Blue Ocean
Commit hash: 2c8bf6d3d4fe497e1d8ff310ce5e5f26b1925faa


Machine information No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
Stepping: 4
CPU MHz: 2400.000
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 1.3 MiB
L1i cache: 1.3 MiB
L2 cache: 40 MiB
L3 cache: 55 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities

G++:
g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang:
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@mitzimorris mitzimorris changed the title Feature/1263 update stansummary to report bulk_ESS, tail_ESS, bulk_Rhat, tail_Rhat, maximum absolute deviation Feature/1263 update stansummary to report rank-normalized ESS tail, ESS bulk, max abs deviation(MAD), and Rhat Sep 27, 2024
@mitzimorris
Copy link
Member Author

in the interest of avoiding omnibus PRs, restored the venerable print command plus unit tests.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
arma/arma.stan 0.38 0.37 1.03 2.53% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.01 0.01 1.05 5.19% faster
gp_regr/gen_gp_data.stan 0.03 0.03 1.03 2.96% faster
gp_regr/gp_regr.stan 0.11 0.09 1.14 12.12% faster
sir/sir.stan 72.49 67.29 1.08 7.18% faster
irt_2pl/irt_2pl.stan 4.45 3.9 1.14 12.27% faster
eight_schools/eight_schools.stan 0.06 0.05 1.09 8.42% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.26 0.24 1.07 6.92% faster
pkpd/one_comp_mm_elim_abs.stan 19.72 18.6 1.06 5.65% faster
garch/garch.stan 0.49 0.41 1.2 16.9% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.8 2.57 1.09 8.32% faster
arK/arK.stan 1.81 1.71 1.06 5.71% faster
gp_pois_regr/gp_pois_regr.stan 2.91 2.83 1.03 2.63% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.93 8.4 1.06 5.94% faster
performance.compilation 189.24 186.56 1.01 1.41% faster
Mean result: 1.0767770971468993

Jenkins Console Log
Blue Ocean
Commit hash: c148b0c9a356ceda75f6c6ee381d5d8ffc12bca0


Machine information No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
Stepping: 4
CPU MHz: 2400.000
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 1.3 MiB
L1i cache: 1.3 MiB
L2 cache: 40 MiB
L3 cache: 55 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities

G++:
g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang:
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@WardBrian
Copy link
Member

I'm in transit today so hard to review, will try to approve tomorrow morning.

It does look like there are a few makefile changes around the print utility that still need to be reverted?

@mitzimorris
Copy link
Member Author

It does look like there are a few makefile changes around the print utility that still need to be reverted?

checked in reverted makefiles.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
arma/arma.stan 0.41 0.43 0.96 -4.6% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.01 0.01 0.69 -45.8% slower
gp_regr/gen_gp_data.stan 0.04 0.03 1.31 23.37% faster
gp_regr/gp_regr.stan 0.11 0.11 1.0 -0.42% slower
sir/sir.stan 80.1 77.18 1.04 3.65% faster
irt_2pl/irt_2pl.stan 4.68 4.64 1.01 0.92% faster
eight_schools/eight_schools.stan 0.09 0.07 1.3 22.85% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.29 0.28 1.04 3.95% faster
pkpd/one_comp_mm_elim_abs.stan 22.57 21.7 1.04 3.87% faster
garch/garch.stan 0.53 0.56 0.95 -5.58% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.09 3.16 0.98 -2.39% slower
arK/arK.stan 2.01 1.98 1.02 1.52% faster
gp_pois_regr/gp_pois_regr.stan 3.2 3.17 1.01 0.74% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 9.95 9.63 1.03 3.19% faster
performance.compilation 240.35 229.97 1.05 4.32% faster
Mean result: 1.0261546218011206

Jenkins Console Log
Blue Ocean
Commit hash: c148b0c9a356ceda75f6c6ee381d5d8ffc12bca0


Machine information No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
Stepping: 4
CPU MHz: 2400.000
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 1.3 MiB
L1i cache: 1.3 MiB
L2 cache: 40 MiB
L3 cache: 55 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities

G++:
g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang:
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
arma/arma.stan 0.43 0.38 1.14 12.32% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.01 0.01 0.96 -3.75% slower
gp_regr/gen_gp_data.stan 0.03 0.03 1.05 5.03% faster
gp_regr/gp_regr.stan 0.11 0.15 0.76 -31.73% slower
sir/sir.stan 75.51 73.21 1.03 3.04% faster
irt_2pl/irt_2pl.stan 4.72 4.48 1.05 5.0% faster
eight_schools/eight_schools.stan 0.06 0.06 0.99 -1.09% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.26 0.26 0.99 -1.23% slower
pkpd/one_comp_mm_elim_abs.stan 20.63 20.37 1.01 1.25% faster
garch/garch.stan 0.5 0.47 1.07 6.58% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.4 2.83 1.2 16.76% faster
arK/arK.stan 1.94 1.94 1.0 -0.14% slower
gp_pois_regr/gp_pois_regr.stan 3.01 3.08 0.98 -2.53% slower
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 9.4 9.15 1.03 2.66% faster
performance.compilation 205.24 202.32 1.01 1.42% faster
Mean result: 1.0185025386234818

Jenkins Console Log
Blue Ocean
Commit hash: c148b0c9a356ceda75f6c6ee381d5d8ffc12bca0


Machine information No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
Stepping: 4
CPU MHz: 2400.000
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 1.3 MiB
L1i cache: 1.3 MiB
L2 cache: 40 MiB
L3 cache: 55 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities

G++:
g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang:
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

src/cmdstan/stansummary.cpp Outdated Show resolved Hide resolved
Comment on lines 437 to 439
if (reorder_params) {
pnames = order_param_names_row_major(param_names);
}
Copy link
Member

Choose a reason for hiding this comment

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

If I am reading this correctly, it is only reordering the names, not the actual numerical values?

Before:

Inference for Stan model: issue_342_model
1 chains: each with iter=(10); warmup=(0); thin=(1); 10 iterations saved.

Warmup took 0.23 seconds
Sampling took 0.0018 seconds

                Mean   MCSE  StdDev       5%   50%   95%  N_Eff   N_Eff/s  R_hat

lp__             -15    1.2     3.7 -2.6e+01   -15   -13     10   5.7e+03   0.92
accept_stat__   0.69   -nan    0.30     0.20  0.86   1.0    -45  -2.6e+04   0.92
stepsize__      0.89    nan    0.00     0.89  0.89  0.89    nan       nan    nan
treedepth__     0.90   0.10    0.32     0.00   1.0   1.0     10   5.7e+03    nan

x[1]            0.61   -nan    0.22  2.8e-01  0.67  0.98    -48  -2.7e+04   0.89
x[2]            0.48  0.051    0.16  1.8e-01  0.48  0.77     10   5.7e+03   0.99
y[1,1]          0.43   0.12    0.39  2.3e-02  0.17  0.93     10   5.7e+03    1.1
y[1,2]          0.60  0.076    0.24  2.5e-01  0.71  0.88     10   5.7e+03   0.90
y[1,3]          0.47   -nan    0.33  4.5e-02  0.71  0.94    -92  -5.2e+04   0.90
y[2,1]          0.51   -nan    0.27  1.7e-01  0.49  0.93   -354  -2.0e+05   0.91
y[2,2]          0.56  0.087    0.28  1.6e-01  0.65  0.99     10   5.7e+03   0.94
y[2,3]          0.52  0.100    0.32  1.9e-03  0.65  0.93     10   5.7e+03    1.2

Samples were drawn using hmc with nuts.
For each parameter, N_Eff is a crude measure of effective sample size,
and R_hat is the potential scale reduction factor on split chains (at 
convergence, R_hat=1).

This PR:

Inference for Stan model: issue_342_model
1 chains: each with iter=10; warmup=1000; thin=1; 10 iterations saved.

Warmup took 0.23 seconds
Sampling took 0.0018 seconds

                Mean   MCSE   StdDev   MAD     5%   50%   95%  ESS_bulk  ESS_tail  R_hat

lp__             -15    1.2  3.7e+00  0.78    -21   -15   -13       5.0       5.0    1.3
accept_stat__   0.69  0.096  3.0e-01  0.25   0.21  0.78  0.99
stepsize__      0.89    nan  1.2e-16  0.00   0.89  0.89  0.89
treedepth__     0.90   0.10  3.2e-01  0.00   0.45   1.0   1.0

x[1]            0.61  0.069  2.2e-01  0.11   0.28  0.67  0.87       5.0       5.0   0.91
x[2]            0.48  0.051  1.6e-01  0.16   0.26  0.45  0.69       5.0       5.0    1.0
y[1,1]          0.43   0.12  3.9e-01  0.15  0.059  0.16  0.93       5.0       5.0    1.4
y[1,2]          0.51  0.087  2.7e-01  0.38   0.17  0.49  0.90       5.0       5.0    1.4
y[1,3]          0.60  0.076  2.4e-01  0.18   0.25  0.66  0.85       5.0       5.0    1.1
y[2,1]          0.56  0.087  2.8e-01  0.31   0.23  0.53  0.93       5.0       5.0   0.92
y[2,2]          0.47   0.10  3.3e-01  0.39  0.068  0.48  0.86       5.0       5.0   0.99
y[2,3]          0.52  0.100  3.2e-01  0.21  0.036  0.54  0.93       5.0       5.0    1.3

Samples were drawn using hmc with nuts.
For each parameter, ESS_bulk and ESS_tail measure the effective sample size 
for the entire sample (bulk) and for the the .05 and .95 tails (tail), 
and R_hat measures the potential scale reduction on split chains.
At convergence R_hat will be very close to 1.00.

The variable names are in the same column, the means etc are jumbled

This also means we apparently have no tests that check that the correct name is actually being paired with the correct mean, etc

Copy link
Member Author

@mitzimorris mitzimorris Oct 30, 2024

Choose a reason for hiding this comment

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

the names are what is used to generate the stats.

void get_stats(const stan::mcmc::chainset &chains, const Eigen::VectorXd &probs,
const std::vector<std::string> &param_names,
Eigen::MatrixXd &stats) {
stats.setZero();
size_t i = 0;
for (std::string name : param_names) {

under the hood, the chainset object translates names to indices.
https://github.com/stan-dev/stan/blob/9048555070493679287a25086e7b85b72ad9531f/src/stan/mcmc/chainset.hpp#L133-L148

in the above output, where are things jumbled?

I see - will check.

Copy link
Member Author

Choose a reason for hiding this comment

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

this time for sure!

Inference for Stan model: issue_342_model
1 chains: each with iter=10; warmup=1000; thin=1; 10 iterations saved.

Warmup took 0.23 seconds
Sampling took 0.0018 seconds

                Mean   MCSE  StdDev   MAD     5%   50%   95%  ESS_bulk  ESS_tail  R_hat

lp__             -15    1.2     3.7  0.78    -21   -15   -13       5.0       5.0    1.3
accept_stat__   0.69  0.096    0.30  0.25   0.21  0.78  0.99
stepsize__      0.89    nan    0.00  0.00   0.89  0.89  0.89
treedepth__     0.90   0.10    0.32  0.00   0.45   1.0   1.0

x[1]            0.61  0.069    0.22  0.11   0.28  0.67  0.87       5.0       5.0   0.91
x[2]            0.48  0.051    0.16  0.16   0.26  0.45  0.69       5.0       5.0    1.0
y[1,1]          0.43   0.12    0.39  0.15  0.059  0.16  0.93       5.0       5.0    1.4
y[1,2]          0.60  0.076    0.24  0.18   0.25  0.66  0.85       5.0       5.0    1.1
y[1,3]          0.47   0.10    0.33  0.39  0.068  0.48  0.86       5.0       5.0   0.99
y[2,1]          0.51  0.087    0.27  0.38   0.17  0.49  0.90       5.0       5.0    1.4
y[2,2]          0.56  0.087    0.28  0.31   0.23  0.53  0.93       5.0       5.0   0.92
y[2,3]          0.52  0.100    0.32  0.21  0.036  0.54  0.93       5.0       5.0    1.3

Copy link
Member Author

Choose a reason for hiding this comment

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

the reordering needs to happen before the stats are computed; not when the stats are written. fixed code and added unit test for this.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
arma/arma.stan 0.4 0.44 0.91 -10.29% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.01 0.01 1.0 -0.15% slower
gp_regr/gen_gp_data.stan 0.03 0.03 0.94 -6.0% slower
gp_regr/gp_regr.stan 0.1 0.11 0.94 -5.83% slower
sir/sir.stan 82.78 77.98 1.06 5.79% faster
irt_2pl/irt_2pl.stan 5.61 5.07 1.11 9.57% faster
eight_schools/eight_schools.stan 0.07 0.06 1.1 8.68% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.29 0.28 1.05 5.15% faster
pkpd/one_comp_mm_elim_abs.stan 22.32 21.54 1.04 3.48% faster
garch/garch.stan 0.59 0.57 1.03 2.8% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.17 3.08 1.03 2.82% faster
arK/arK.stan 2.03 2.01 1.01 1.19% faster
gp_pois_regr/gp_pois_regr.stan 3.29 3.3 1.0 -0.32% slower
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 9.9 10.25 0.97 -3.62% slower
performance.compilation 214.57 210.38 1.02 1.95% faster
Mean result: 1.0131898358619498

Jenkins Console Log
Blue Ocean
Commit hash: c148b0c9a356ceda75f6c6ee381d5d8ffc12bca0


Machine information No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
Stepping: 4
CPU MHz: 2400.000
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 1.3 MiB
L1i cache: 1.3 MiB
L2 cache: 40 MiB
L3 cache: 55 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities

G++:
g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang:
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Copy link
Member

@WardBrian WardBrian left a comment

Choose a reason for hiding this comment

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

Okay, something breaks when you have array-of-tuples.

Here's a model:

parameters {
  tuple(real, matrix[2,3]) x;
  array[3,2] tuple(real, real) y;
}
model {
  x.1 ~ normal(0, 1);
  to_vector(x.2) ~ normal(0, 4);
  for (i in 1:3) {
    y[i,1].1 ~ normal(0, 1);
    y[i,2].1 ~ normal(0, 2);
    y[i,1].2 ~ normal(0, 3);
    y[i,2].2 ~ normal(0, 4);
  }
}

current stansummary:

Inference for Stan model: foo_model
1 chains: each with iter=(1000); warmup=(0); thin=(1); 1000 iterations saved.

Warmup took 0.018 seconds
Sampling took 0.027 seconds

                    Mean     MCSE  StdDev    5%       50%   95%  N_Eff  N_Eff/s  R_hat

lp__            -9.6e+00     0.17     3.2   -16  -9.2e+00  -5.2    368  1.4e+04    1.0
accept_stat__       0.87  4.0e-03    0.13  0.62      0.90   1.0   1025    37961    1.0
stepsize__          0.62      nan    0.00  0.62      0.62  0.62    nan      nan    nan
treedepth__          3.0  5.4e-03    0.15   3.0       3.0   3.0    771    28545   1.00
n_leapfrog__         7.0  1.4e-02    0.42   7.0       7.0   7.0    862    31940    1.0
divergent__         0.00      nan    0.00  0.00      0.00  0.00    nan      nan    nan
energy__              19  2.4e-01     4.4    13        19    28    351    12988    1.0

x.1             -2.2e-02    0.022    0.99  -1.6   4.0e-03   1.6   1998  7.4e+04   1.00
x.2[1,1]        -5.6e-02    0.090     4.2  -7.0  -2.0e-01   7.0   2225  8.2e+04    1.0
x.2[1,2]         2.9e-02    0.087     4.0  -6.7  -7.4e-02   6.6   2151  8.0e+04   1.00
x.2[1,3]        -2.2e-02    0.090     4.0  -6.5  -8.4e-02   6.6   1955  7.2e+04   1.00
x.2[2,1]         2.0e-02    0.098     3.9  -6.6  -7.2e-02   6.4   1611  6.0e+04   1.00
x.2[2,2]        -1.5e-01    0.092     4.1  -6.8  -2.2e-01   6.6   2021  7.5e+04   1.00
x.2[2,3]         1.0e-01    0.090     3.8  -6.2   1.6e-01   6.4   1787  6.6e+04    1.0
y[1,1].1         4.0e-02    0.023    0.99  -1.6   6.9e-02   1.6   1823  6.8e+04    1.0
y[2,1].2         3.7e-02    0.056     3.1  -5.0   3.3e-03   5.1   3000  1.1e+05   1.00
y[1,1].2         7.3e-03    0.061     2.9  -4.8   5.5e-02   4.9   2302  8.5e+04   1.00
y[3,1].1         5.8e-03    0.021    0.97  -1.6   3.5e-02   1.6   2190  8.1e+04   1.00
y[2,1].1        -1.8e-02    0.021     1.1  -1.7   1.0e-02   1.7   2507  9.3e+04   1.00
y[3,1].2         2.5e-03    0.069     3.2  -5.4   1.9e-02   5.3   2184  8.1e+04   1.00
y[1,2].1         2.2e-02    0.041     2.0  -3.2   3.5e-02   3.3   2381  8.8e+04   1.00
y[2,2].2        -1.4e-02    0.091     4.2  -6.8  -1.6e-01   6.8   2139  7.9e+04   1.00
y[1,2].2        -3.5e-02    0.089     4.0  -6.3   9.7e-02   6.5   2057  7.6e+04   1.00
y[3,2].1         1.5e-02    0.040     1.9  -3.1   4.2e-02   3.0   2323  8.6e+04   1.00
y[2,2].1        -7.0e-02    0.036     2.0  -3.4  -1.2e-01   3.4   3000  1.1e+05   1.00
y[3,2].2        -9.3e-02    0.083     4.0  -6.7  -1.7e-02   6.2   2280  8.4e+04   1.00

Samples were drawn using hmc with nuts.
For each parameter, N_Eff is a crude measure of effective sample size,
and R_hat is the potential scale reduction factor on split chains (at 
convergence, R_hat=1).

This PR:

Error during processing. Unknown parameter name y[1,1]

Comment on lines +159 to +162
auto find_dups
= std::find(invalid_params.begin(), invalid_params.end(), request);
if (find_dups == invalid_params.end()) {
invalid_params.emplace_back(request);
Copy link
Member

Choose a reason for hiding this comment

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

Consider making invalid a set to avoid this?

@WardBrian
Copy link
Member

WardBrian commented Oct 31, 2024

I'm hoping the above is the last issue, but it's hard to say. I don't know if it is necessary to touch the code as much as this PR does -- it seems to me like, in the abstract, basically only changing the get_header and get_stats functions could be enough? And then it would not require all the additional review on the reordering etc, while maintaining existing behavior

@WardBrian
Copy link
Member

Here's an example of what I mean: https://github.com/stan-dev/cmdstan/compare/stansummary-new-stats

Before updating the tests, this diff is only at +59-76, and it adds the ess_bulk, ess_tail, MAD, and new R-Hat to stansummary.

If you do want to stop plugging away on this I'd be happy to push it further

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
arma/arma.stan 0.56 0.5 1.12 10.6% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.03 0.01 2.36 57.68% faster
gp_regr/gen_gp_data.stan 0.07 0.03 2.17 53.95% faster
gp_regr/gp_regr.stan 0.21 0.11 1.86 46.34% faster
sir/sir.stan 78.06 75.14 1.04 3.74% faster
irt_2pl/irt_2pl.stan 6.2 5.51 1.13 11.16% faster
eight_schools/eight_schools.stan 0.06 0.06 0.99 -0.52% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.72 0.27 2.72 63.26% faster
pkpd/one_comp_mm_elim_abs.stan 23.86 22.18 1.08 7.02% faster
garch/garch.stan 0.93 0.6 1.54 35.27% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 4.18 3.07 1.36 26.58% faster
arK/arK.stan 2.75 1.95 1.41 29.18% faster
gp_pois_regr/gp_pois_regr.stan 4.97 3.12 1.59 37.21% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 12.67 9.69 1.31 23.52% faster
performance.compilation 198.77 201.15 0.99 -1.2% slower
Mean result: 1.5119811648462536

Jenkins Console Log
Blue Ocean
Commit hash: b88ac6535111d0a72e585fc78fc4fa664aeadc51


Machine information No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 80
On-line CPU(s) list: 0-79
Thread(s) per core: 2
Core(s) per socket: 20
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
Stepping: 4
CPU MHz: 2400.000
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 1.3 MiB
L1i cache: 1.3 MiB
L2 cache: 40 MiB
L3 cache: 55 MiB
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; IBRS; IBPB conditional; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities

G++:
g++ (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clang:
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@mitzimorris
Copy link
Member Author

hi Brian, you're welcome to take over.
cheers,
Mitzi

WardBrian added a commit that referenced this pull request Oct 31, 2024
WardBrian added a commit that referenced this pull request Nov 1, 2024
Also fix CSV precision bug in matrix outputs
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.

4 participants