I have noticed that model compilation in cmdstan takes ~10 times longer when I am connected to my work wifi network. I am a bit confused, because I assumed there should be no link between being connected to the internet and model compilation process. However, the empirical difference is ridiculous. Does anyone know why this might be happening?
Yes, I am currently simply disconnecting from the internet whenever I need to compile a model.
To answer your question, I just tested it by connecting to my mobile data, and itās as fast as offline, so it seems only my work wifi slows it down considerably⦠I imagine it has something to do with security, but I am very puzzled how is it possible and whether there is any way around it, apart from disconnecting each time I compile.
This is puzzling. The only thing the cmdstan build process shells out to the internet for is to download the stanc3 compiler in development builds. In a released CmdStan, it shouldnāt connect at all.
You can try disabling this ability entirely by passing STANC3=some/path/that/exists/ to make. This will tell it to try to build stanc from sources found in that folder ā which you donāt have or need, but it completely disables the download ability, so it should give us good information either way.
The other thing Iāve thought about is certain antivirus software is very suspicious of compilations. Touching a lot of files and writing out new ones looks a lot like some kinds of ransomware. Is it possible that connecting to your work wifi is enabling some extra protections?
Yes, this seems very likely. Since itās a governmental institution, the security is pretty ridiculous. Iāll drop a query to the IT team about this, cause I assume I canāt really do much about this on my own. Thanks!
I work remote and my company uses Zscaler for network security and VPN. If I disconnect from the internet the performance improves significantly.
Internet Enabled
STANC3 Set
Compile Time
Yes
Yes
103 sec
Yes
No
104 sec
No
Yes
36 sec
No
No
40 sec
As you can see, setting the STANC3 environment variable appears to have minimal impact on compilation time.
If thereās an alternative way to pass this variable to the make utilityāparticularly when using the cmdstan_model() functionāIād appreciate any guidance. I wasnāt able to find a documented method for doing so.
On my home computer, this compiles in about 15 seconds. So, there may also be some anti-virus software issues which I will address with the security separately.
While monitoring the output during compilation, the slowdown seems to occur both before the C++ compiler starts and slightly afterward.
Could you elaborate on what processes are happening behind the scenes during these phases? Understanding this would help our security team determine how best to allow the necessary connections without introducing security risks.