Re: [Rd] confint Attempts to Use All Server CPUs by Default

2024-05-22 Thread Dario Strbenac via R-devel
Hello,

It is from the stats package and applied to the output of logistic regression 
as implemented by glm with setting family = "binomial". So, it is a base 
package and not an add-on CRAN package. I shall recommend linking to FlexiBLAS 
to our system administrator.

--
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] confint Attempts to Use All Server CPUs by Default

2024-05-22 Thread Ben Bolker
  Following up on this -- on my system, I have 69 packages installed 
that appear to provide something like a confint() method:


h <-  help.search("confint", agrep = FALSE)
p <- sort(unique(h$matches$Package))
length(p)
## [1] 69

p

 [1] "bamlss"  "bbmle"   "binom"   "brglm2" 

 [5] "broom"   "caper"   "car" "CDM" 

 [9] "CLME""coin""crosstable"  "dclone" 


[13] "doBy""drc" "Ecfun"   "emmeans"
[17] "epigrowthfit""evd" "Exact"   "fitode"
[21] "fixest"  "ggfortify"   "ggplot2" "GLMMadaptive"
[25] "glmmTMB" "gratia"  "hdm" "JMbayes"
[29] "JointAI" "lava""lme4""lmeresampler"
[33] "lmtest"  "logistf" "MASS""maxLik"
[37] "metafor" "mitml"   "MKmisc"  "mmrm"
[41] "mosaic"  "MplusAutomation" "multcomp""ordinal"
[45] "papaja"  "parsnip" "prodlim" "R2admb"
[49] "rethinking"  "riskRegression"  "RSA" "rstanarm"
[53] "rxode2"  "segmented"   "simr""sirt"
[57] "sn"  "spaMM"   "stats"   "stats4"
[61] "strucchange" "survey"  "survival""systemfit"
[65] "TMB" "unmarked""vegan"   "VGAM"
[69] "zipfR"

 If a confint() method were actually included in the package test 
suite, I would expect this kind of problem to be caught by CRAN checks 
(which look for code that is being greedy with parallelization). But 
it's perfectly possible that a package maintainer neglected to include 
such tests ...



On 2024-05-21 6:00 a.m., Ivan Krylov via R-devel wrote:

В Tue, 21 May 2024 08:00:11 +
Dario Strbenac via R-devel  пишет:


Would a less resource-intensive value, such as 1, be a safer default
CPU value for confint?


Which confint() method do you have in mind? There is at least four of
them by default in R, and many additional classes could make use of
stats:::confint.default by implementing vcov().


Also, there is no mention of such parallel processing in ?confint, so
it was not clear at first where to look for performance degradation.
It could at least be described in the manual page so that users would
know that export OPENBLAS_NUM_THREADS=1 is a solution.


There isn't much R can do about the behaviour of the BLAS, because
there is no standard interface to set the number of threads. Some BLASes
(like ATLAS) don't even offer it as a tunable number at all [*].

A system administrator could link the installation of R against
FlexiBLAS [**], provide safe defaults in the environment variables and
educate the users about its tunables [***], but that's a choice just
like it had been a choice to link R against a parallel variant of
OpenBLAS on a shared computer. This is described in R Installation and
Administration, section A.3.1 [].



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] confint Attempts to Use All Server CPUs by Default

2024-05-21 Thread Ivan Krylov via R-devel
В Tue, 21 May 2024 08:00:11 +
Dario Strbenac via R-devel  пишет:

> Would a less resource-intensive value, such as 1, be a safer default
> CPU value for confint?

Which confint() method do you have in mind? There is at least four of
them by default in R, and many additional classes could make use of
stats:::confint.default by implementing vcov().

> Also, there is no mention of such parallel processing in ?confint, so
> it was not clear at first where to look for performance degradation.
> It could at least be described in the manual page so that users would
> know that export OPENBLAS_NUM_THREADS=1 is a solution.

There isn't much R can do about the behaviour of the BLAS, because
there is no standard interface to set the number of threads. Some BLASes
(like ATLAS) don't even offer it as a tunable number at all [*].

A system administrator could link the installation of R against
FlexiBLAS [**], provide safe defaults in the environment variables and
educate the users about its tunables [***], but that's a choice just
like it had been a choice to link R against a parallel variant of
OpenBLAS on a shared computer. This is described in R Installation and
Administration, section A.3.1 [].

-- 
Best regards,
Ivan

[*]
https://math-atlas.sourceforge.net/faq.html#tnum

[**]
https://www.mpi-magdeburg.mpg.de/projects/flexiblas

[***]
https://search.r-project.org/CRAN/refmans/flexiblas/html/flexiblas-threads.html

[]
https://cran.r-project.org/doc/manuals/R-admin.html#BLAS

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] confint Attempts to Use All Server CPUs by Default

2024-05-21 Thread Dario Strbenac via R-devel
Hello,

Would a less resource-intensive value, such as 1, be a safer default CPU value 
for confint? I noticed excessive CPU usage on a I.T. administrator-managed 
server which was being three-quarters used by another staff member when the 
confidence interval calculation in an R Markdown document suddenly changed from 
two seconds to ninety seconds because of competition for CPUs between users. 
Also, there is no mention of such parallel processing in ?confint, so it was 
not clear at first where to look for performance degradation. It could at least 
be described in the manual page so that users would know that export 
OPENBLAS_NUM_THREADS=1 is a solution.

--
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel