-
Notifications
You must be signed in to change notification settings - Fork 810
modified makefile for properly supporting python 3 in system install … #426
base: master
Are you sure you want to change the base?
modified makefile for properly supporting python 3 in system install … #426
Conversation
…and also modified makefile for properly supporting system install for python 2. Fixes issue # 411 reported on github.
In the above PR, the number of tests failed was reduced to 1, not related to the PR: `====================================================== FAILURES ====================================================== backend_default = <neon.backends.nervanacpu.NervanaCPU object at 0x7f0f5fee4198>, fargs_tests = (7, 2, 1)
E assert False tests/test_dilated_conv.py:174: AssertionError |
Thanks for your PR, we will look into bringing your PR in. |
@armando-fandango Some issue for python3 sysinstall is due to the system having default python2. Have you tried python3 system install under a python3 virtualenv? |
@baojun-nervana The sysinstall means I want to install as a shared library at the system level, not in the virtual environment. Hence I did not understand the meaning of your comment : "Have you tried python3 system install under a python3 virtualenv?" The system install, whether for python 2 or python 3, should not ask for the virtual environment to be installed or to be present. |
@armando-fandango Sorry for the confusion. When I said "python3 virtualenv", I mostly meant to have a system / environment with python3 as default. In that case, paths and links will be ready for python3, e.g. pip will have a softlink to pip3. Virtualenv is an easy way to have that environment ready, and "make sysinstall" will work smoothly. I agree it is confusing to request virtualenv for sys install. |
Yes virtualenv is a nice way to create virtual environments with different versions of python etc., but for production environment, sometimes we install python 3 at system level and python 2 is not available, hence the sysinstall previously did not work for such cases. |
Actually from the makefile, it seems like that the intent of original makefile author was to install in virtual environment unless 'sys' prefix was added to install and clean. I think the makefile should be refactored heavily to allow for different parameters such as --env=virtual or non-virtual, --python=2 or 3, --system etc |
There is a parameter PY = 2 or 3 (line 129) which is mostly used to diff venv for python 2 and 3. We may expand that to differ python and pip command for python 2 and 3. it will be something like the following: ifeq ($(PY), 2) In the recipes, it can be called as neon_install: This way it will be an integrated recipe for python2 and 3. To run python3 sysinstall, it will be make PY=3 sysinstall @armando-fandango Are you interested in updating the PR to merge the python2 and 3 sys install recipes? |
Yes I can update my PR to have the recipes as you mentioned. Sounds good.
…-- Armando
Sent from phone.
On Dec 22, 2017, at 5:18 PM, baojun ***@***.***> wrote:
There is a parameter PY = 2 or 3 (line 129) which is mostly used to diff venv for python 2 and 3. We may expand that to differ python and pip command for python 2 and 3.
it will be something like the following:
ifeq ($(PY), 2)
.......
PYTHON_EXE := python
PIP_EXE := pip
else
........
PYTHON_EXE := python3
PIP_EXE := pip3
endif
In the recipes, it can be called as $(PYTHON_EXE) and $(PIP_EXE). The neon_install recipe will be like:
neon_install:
@echo "Installing neon system wide..."
@$(PYTHON_EXE) setup.py install
@echo
This way it will be an integrated recipe for python2 and 3.
To run python3 sysinstall, it will be
make PY=3 sysinstall
@armando-fandango Are you interested in updating the PR to merge the python2 and 3 sys install recipes?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
…and also modified makefile for properly supporting system install for python 2. Fixes issue # 411 reported on github.
Also made dependency on virtualenv conditional as for sysinstall it is not required to have virtualenv or activate virtualenv.
Installed with make sysinstall_python3, make_sysinstall and Tested with make syscheck.
armando@librenix:~/projects/github/neon$ sudo make syscheck
"Skipping virtualenv check for system install / uninstall"
Running style checks. Number of style errors is...
flake8 --count neon bin/* tests examples benchmark
> /dev/null
Number of missing docstrings is...
pylint --disable=all --enable=missing-docstring -r n
neon | grep "^C" | wc -l
465
Running unit tests...
py.test -m "hasgpu or not hasgpu and not mkl_only" tests/ | tail -1 | cut -f 2,3 -d ' '
Exception ignored in: <bound method NervanaGPU.del of <neon.backends.nervanagpu.NervanaGPU object at 0x7f4b27657e48>>
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/nervananeon-2.4.0-py3.5.egg/neon/backends/nervanagpu.py", line 893, in del
self.ctx.detach()
AttributeError: 'NervanaGPU' object has no attribute 'ctx'
PyCUDA WARNING: a clean-up operation failed (dead context maybe?)
cuCtxDetach failed: invalid device context
2 failed,
Two errors still occur in GPU code: However, the intent of this PR is not to fix the GPU portions, but the makefile.