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
Conda fixes #5290
Conda fixes #5290
Conversation
I should say, I plan to rebuild the theano packages when rc1 is ready so people can test them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one small change before merging and one comments/questions in case you know better then me.
Thanks
# Add sys.prefix/lib to the runtime search path. On | ||
# non-system installations of Python that use the | ||
# system linker, this is generally neccesary. | ||
if sys.platform in ("linux", "darwin"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abergeron I think this is good and would help fix Mac problem. Just to make you know about this change to be merged soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it does help on mac, that's great. But from what I observed I doubt it. We should test that.
@@ -430,7 +430,7 @@ def f(suffix=suffix): | |||
except OSError: | |||
rc = 1 | |||
if rc != 0: | |||
_logger.warning("conda g++ not available, use `conda install m2w64-toolchain`") | |||
_logger.warning("g++ not available, if using conda: `conda install m2w64-toolchain`") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this warning. I think it will be triggered too often. People not using conda could need the code after this and won't have mkl. I see 2 possibles fix:
- Do the check for conda and keep the warning here. I prefer this option, I think it is fine to have only one place with a check for conda. This will ensure that conda user use mkl.
- Just record here that mkl isn't available. Then if we can't find a blas in this function, raise this warning. So mostly, postpone this warning to the end of this method in case we don't find a blas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will change it to look for "Continuum", or anything containing "conda" as that will get both "conda-forge" and "Anaconda".
@@ -31,10 +31,6 @@ | |||
|
|||
import sys | |||
|
|||
if sys.platform == 'win32' and sys.version_info[0:2] == (3, 5): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an error report with WinPython 3.5 on windows:
I don't have objection to removing the check, but I fear that there is still some python 3.5 on windows that have problems. conda and the official python are fine from what you tell. Do you have an idea why winpython have a problem?
People with python 3.5 not support will still get an error, just an error very hard to understand. If you have an idea how we could detect here if we support the current Python 3.5 on Windows, it would be great.
Otherwise, I think we will keep this and probably add a note in the installation of windows that it is not all python 3.5 that are supported.
Hello ! Just to say that I have just tested this PR with the test These are the commands executed: For Python 2:conda create --yes -n python2test python=2
activate python2test
conda install --yes numpy scipy mkl-service nose sphinx pydot-ng m2w64-gcc libpython
pip install git+https://github.com/mingwandroid/Theano.git@conda-fixes
python -m theano.misc.check_blas > log-python2.log 2>&1
python -V
rem Python 2.7.12 :: Continuum Analytics, Inc.
python -c "import platform; print (platform.platform())"
rem Windows-8.1-6.3.9600
python -c "import theano; print(theano.__version__)"
rem 0.9.0dev4.dev-c18e654db3b38c8d31b2cb5d94367e28d62f44aa
deactivate
conda remove --yes --all -n python2test For Python 3:conda create --yes -n python3test python=3
activate python3test
conda install --yes numpy scipy mkl-service nose sphinx m2w64-gcc libpython
pip install pydot
pip install git+https://github.com/mingwandroid/Theano.git@conda-fixes
python -m theano.misc.check_blas > log-python3.log 2>&1
python -V
rem Python 3.5.2 :: Continuum Analytics, Inc.
python -c "import platform; print (platform.platform())"
rem Windows-8.1-6.3.9600-SP0
python -c "import theano; print(theano.__version__)"
rem 0.9.0dev4.dev-c18e654db3b38c8d31b2cb5d94367e28d62f44aa
deactivate
conda remove --yes --all -n python3test Some remarks:
|
Thanks for checking.
All those |
Oh, |
c18e654
to
dfdcfb2
Compare
I do not have winpython 3.5 installed, but if you wish, I can try to take a look? |
Travis have some errors. Some some of them: https://travis-ci.org/Theano/Theano/jobs/179590558#L532 |
else: | ||
# This branch is executed if no exception was raised | ||
if sys.platform == "win32": | ||
lib_path = os.path.join(sys.prefix, 'Library', 'bin') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On windows, lib_path is a list and otherwise, it is a list. I thin it should always be a list, so wrap this in a list here.
blas_info.get('library_dirs', [])]) | ||
res = try_blas_flag(flags) | ||
if res: | ||
maybe_add_to_os_environ_pathlist('PATH', lib_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that lib_path will always be a list, use lib_path[0]
sys.prefix/DLLs for MKL DLLs
Many Windows users avoid the command-line and are unfamiliar with env. vars. They can elect to use Anaconda/Miniconda Python as their system Python and in that case would not be able to take advantage of g++ or mkl. This commit works around these issues by adding the appropriate values to os.environ['PATH'] if they are not already on PATH.
Since each of Anaconda/Miniconda/conda-forge change sys.version to contain different things, and some users may install MKL outside of conda, always try the import and then, if using conda, give some useful information on how to install MKL (by installing `mkl-service` not `mkl`).
dfdcfb2
to
f257350
Compare
Is this ready to go? I believe I've addressed all the change requests? Thanks. |
# Anaconda on Windows has mingw-w64 packages including GCC, but it may not be on PATH. | ||
if rc != 0: | ||
if sys.platform == "win32": | ||
mingw_w64_gcc = os.path.join(os.path.dirname(sys.executable), "Library", "mingw-w64", "bin", "g++") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supported for 32-bits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That supports both no problem.
mingw-w64 is just the project name to differentiate it from mingw.org.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
try: | ||
rc = call_subprocess_Popen([mingw_w64_gcc, '-v']) | ||
if rc == 0: | ||
maybe_add_to_os_environ_pathlist('PATH', os.path.dirname(mingw_w64_gcc)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the value of the cxx config param is a full path, so we can set it to the full path to g++ here and not fiddle with PATH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to add to PATH I am afraid, otherwise companion tools (linker, cc1) are not found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
# Add sys.prefix/lib to the runtime search path. On | ||
# non-system installations of Python that use the | ||
# system linker, this is generally neccesary. | ||
if sys.platform in ("linux", "darwin"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it does help on mac, that's great. But from what I observed I doubt it. We should test that.
I'm basically ok with everything. We should just test the mkl part on mac to see if it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why it works on mac (because everything I know tells me it shouldn't), but it does, so I'm ok.
Thanks for all the work. I think all is good for this PR. This week we should do a beta and not a release candidate. We want to make a release this week and there is probably too much stuff to finish this week, so we will go for a beta. I lost the status of the conda packages of Theano and libgpuarray. Is there still work to do for them? thanks. |
Thanks for the reviews. Conda-wise I am in pretty good shape now I think. Everything appears to be working and all my patches are upstreamed. I don't have an Nvidia GPU nor OpenCL capable AMD so that side of things I cannot test so easily which is a shame. When you are ready for the beta I will build new packages and if you were able to test them out on such hardware/drivers then that would be great. I did notice a good few warnings from libgpuarray on Windows and some looked like they warranted more investigation so when I rebuild them I will check into that and send logs to you both. |
Because I pushed a version of this branch which was the same as master, Github seems to have closed my old PR against it. Reopening here instead, shame we lost the conversation thread.
I made some test releases for all OSes that Conda supports on https://anaconda.org/rdonnelly from the latest code as of about 11am UTC. This PR has been rebased to the latest master branch.
If you have time to check them I'd appreciate it.
The conda-recipes are at:
https://github.com/mingwandroid/conda-recipes/tree/master/libgpuarray (this one has two patches, I can make a PR for them if you wish)
https://github.com/mingwandroid/conda-recipes/tree/master/python/pygpu (again, two patches).
https://github.com/mingwandroid/conda-recipes/tree/master/python/theano