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

'gcc' module required by 'slurm-drmaa' results in theano BLAS warning #151

Closed
jhrcook opened this issue Feb 2, 2022 · 4 comments · Fixed by #154
Closed

'gcc' module required by 'slurm-drmaa' results in theano BLAS warning #151

jhrcook opened this issue Feb 2, 2022 · 4 comments · Fixed by #154
Labels
bug Something isn't working

Comments

@jhrcook
Copy link
Member

jhrcook commented Feb 2, 2022

The slurm-drmaa module is required for Snakemake to use O2. The slurm-drmaa module requires the gcc module. Loading the gcc module results in the theano BLAS warning.

@jhrcook jhrcook added the bug Something isn't working label Feb 2, 2022
@jhrcook
Copy link
Member Author

jhrcook commented Feb 2, 2022

Without gcc:

Python 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:41:03)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import theano
>>> theano.config.cxx
'/home/jc604/.conda/envs/speclet/bin/g++'
>>> theano.config.blas__ldflags
'-L/home/jc604/.conda/envs/speclet/lib -lcblas -lblas -lcblas -lblas'
>>> theano.config.gcc__cxxflags
''
>>>

With gcc:

Python 3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:41:03)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import thaeano
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'thaeano'
>>> import theano
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
>>> theano.config.cxx
'/n/app/gcc/6.2.0/bin/g++'
>>> theano.config.blas__ldflags
''
>>> theano.config.gcc__cxxflags
''
>>>

@jhrcook
Copy link
Member Author

jhrcook commented Feb 3, 2022

For reference, pymc-theano (Aesara) configuration: https://aesara.readthedocs.io/en/latest/library/config.html

Setting the flags manually removes the BLAS warning even if O2's gcc module is loaded. (I tested against the control without setting the flags and warning reappears.)

module load gcc
MY_THEANO_FLAGS="cxx='/home/jc604/.conda/envs/speclet/bin/g++',blas__ldflags='-L/home/jc604/.conda/envs/speclet/lib -lcblas -lblas -lcblas -lblas'"
THEANO_FLAGS=$MY_THEANO_FLAGS speclet/command_line_interfaces/fit_bayesian_model_cli.py  \
  "hierarchical-nb" \
  models/model-configs.yaml \
  PYMC3_MCMC  \
  temp/fitting-mcmc \
  --mcmc-chains 1  \
  --mcmc-cores 1  \
  --cache-name='test-run'

(Edit: misspelled "FLAGS" in MY_THEANO_FLAGS.)

@jhrcook
Copy link
Member Author

jhrcook commented Feb 3, 2022

Solution: Add this flag to the current speclet.pipelines.theano_flags.get_theano_flags() function.

Steps:

  • Add this flag to the current speclet.pipelines.theano_flags.get_theano_flags() function.
  • Add a project configuration parameter for the contents of this additional flag.
  • Document this configuration parameter in the README.

jhrcook added a commit that referenced this issue Feb 3, 2022
@jhrcook
Copy link
Member Author

jhrcook commented Feb 3, 2022

I made a mistake: The new flags need to use the correct conda environment. Snakemake makes a new environment for the pipeline, so I cannot set it as the prefix for speclet. I need to use the global environment variable CONDA_PREFIX.

❯ conda activate speclet
❯ echo $CONDA_PREFIX
/home/jc604/.conda/envs/speclet

@jhrcook jhrcook linked a pull request Feb 14, 2022 that will close this issue
@jhrcook jhrcook closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant