Help needed: RStan 2.18.1 on windows with a Coffee Lake processor

Is there anyone that

  1. Has a Coffee Lake processor (likely if you bought your computer new in the last 12 months)
  2. Uses Windows
  3. Has already installed rstan 2.18.1 (don’t if you haven’t already)
  4. Is willing to test whether adding -mtune=native -march=native to CXX14FLAGS in their ~/.R/Makevars file to see if a Stan program crashes (i.e. example(stan_model, package = "rstan", run.dontrun = TRUE))

? If so, please report whether it crashes or runs.

1 Like

How the hell do I pin this to the top of the list of topics? We need someone that meets the criteria to test this ASAP.

does @jonah have the power to do this?

I slightly changed the title to make it more informative.

Just to clarfiy, it should have the rstan 2.18.1 already installed?

If I would get access to a machine without rstan and would install rstan 2.18.1 on it would that help?

I guess Ben wrote " 3. Has already installed rstan 2.18.1 (don’t if you haven’t already)" because 2.18.1 might not work and he didn’t want to anyone to destroy their working environment, but certainly if you install 2.18.1 then you fulfill the required condition :)

1 Like

There are no virtual envs in R?

You could use, e.g., conda, but again I guess Ben hoped someone would have a suitable configuration already and he assumed that there are not that many Windows users using virtual environments.

@Matthijs might be able to help? I think he recently bought a laptop?

Yes, I should say if you have access to a Coffee Lake that you do not have to rely on it having a working rstan, then go ahead and upgrade it to 2.18.1 and try putting the -march=native -mtune=native thing into CXX14FLAGS to see if g++-4.9.3 can tune the binary to an instruction set that did not exist when g++-4.9.3 was last updated.

I’m running windows on a Kaby Lake cpu, but happy to help if that’s also relevant.

I tried it on a Coffee Lake 8700K. Fresh install rstan (Version 2.18.1, GitRev: 2e1f913d3ca3). The example you gave compiled and ran with and without those flags.

I did have to create a Makevars.win file for it to work at all:

CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function -mtune=native -march=native
CXX14 = $(BINPREF)g++ -m$(WIN) -std=c++1y
CXX11FLAGS=-O3 -Wno-unused-variable -Wno-unused-function

Hope this helps.

2 Likes

That does help thanks. Hopefully the tuning crashes that people encountered in the past were a result of it tuning to the pre-CXX11 standard.

1 Like

Paul already tried it without crashing on a Kaby Lake so it looks like we are good on all aquatic processors.