ray-project / ray

Ray is a unified framework for scaling AI and Python applications. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
33.1k stars 5.6k forks source link

Update installation docs to describe how to build Ray with Bazel. #4146

Closed robertnishihara closed 5 years ago

robertnishihara commented 5 years ago

Both https://github.com/ray-project/ray/blob/master/doc/source/installation.rst and https://github.com/ray-project/ray/blob/master/java/doc/installation.rst need to be updated.

bjg2 commented 5 years ago

What's the change? We synced and first couldn't build, then we did git clean -f -f -x -d and installed cython==0.29.5 and now we get Segmentation fault (core dumped), how to build now?

pcmoritz commented 5 years ago

If you clean it and run pip install -e . that's the right way to do it, but you also have to use anaconda packages for development right now, see https://github.com/ray-project/ray/issues/4129

If you install tensorflow and scipy from anaconda and use opencv-python-headless instead of opencv-python, the segfaults will go away (TensorFlow and opencv-python are distributing non-compliant wheels and they are clashing with current up-to-date pyarrow wheels).

I'm currently working on getting a version of the pyarrow wheels up that don't clash with TensorFlow and then this problem will go away. See also https://groups.google.com/forum/#!search/manylinux1/ray-dev/gbYKK9Gy_ns/PYuai11YAgAJ.

denkoRa commented 5 years ago

Hi @pcmoritz , I took your advice, executed git clean -f -f -x -d and installed tensorflow/scipy via anaconda (tensorflow-gpu 1.12.0 and scipy 1.2.0) and installing opencv-python-headless, and still I am having the same problem with Segmentation fault (core dumped). I am using bazel version 0.22.0 and anaconda version 1.7.2.

Steps taken:

This mini test works for me too.

import ray

ray.init()

@ray.remote
def func(num):
    return num + 6

ray.get(func.remote(5))

It appears that it crashes when I import ray.tune. Basically this is enough for me to get Segmentation fault

>>> import ray.tune
Segmentation fault (core dumped)

Without ray.tune module I can run my app just fine.

Note that my peers managed to get ray working with same or similar setup. Do you have any advice on how to fix that issue?

pcmoritz commented 5 years ago

@denkoRa Thanks for the report!

I'm currently in the process of building pyarrow wheels that should be more compatible with TensorFlow and scipy.

Could you edit ray/build.sh and replace

  $PYTHON_EXECUTABLE -m pip install \
      --target=$ROOT_DIR/python/ray/pyarrow_files pyarrow==0.12.0-RAY \
      --find-links https://s3-us-west-2.amazonaws.com/arrow-wheels/bf0f3a15e0d6583cfaedbca508627b06746fa41a/index.html

with

  $PYTHON_EXECUTABLE -m pip install \
      --target=$ROOT_DIR/python/ray/pyarrow_files \
      https://s3-us-west-2.amazonaws.com/arrow-wheels/tmp/pyarrow-0.13.0.RAY2-cp36-cp36m-linux_x86_64.whl

rerun setup.py and let me know if that fixes your problem? (this is a temporary fix to try this out in your environement and will only work with python 3.6).

In my testing, the only remaining incompatibility of the new wheels is with opencv-python, but if I replace it with opencv-python-headless everythong works fine for me. We are planning to deploy these to users at some future point, so it would be great to get feedback if it works with your environment or if there is any other packages that are incompatible.

If you are still blocked on this after the change, I'd recommend to use the ray wheels for now if that's possible. But please do let use know because we need a solution that works well for a wide variety of users.

Thanks for your help!

denkoRa commented 5 years ago

@pcmoritz it works after those changes. Thanks a lot!

Maxwell2017 commented 3 years ago

Hi @denkoRa ,I am currently trying to use rllib to train a dmlab30 game. Have you succeeded? How should I use gym to Package dmlab30, I am new to RL, sorry for the basic question。