bartz.mcmcstep.AutoOneHotReduction¶
- class bartz.mcmcstep.AutoOneHotReduction(min_matmul_bins=8)[source]¶
OneHotReductionthat picksmethodandn_innerautomatically.Resolves both knobs from trace-time information per site and platform, then delegates to a plain
OneHotReduction. Usesmatmulonly for wide-bin multivariate reductions andmultiplyotherwise, orchunkedin its place on cpu; lays the datapoints on the inner axis withchunkedand for the cuda count, on the outer axis otherwise. The count and precision sites support only cpu and cuda, raising at lowering elsewhere.The site is recovered from the value: scalar is the count, a wide output the residual, a narrow non-scalar output the precision.
Known limitation: the wide-bin univariate residual on cpu past ~10^6 datapoints prefers a layout this picks against (up to ~2x slower).