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.04k stars 5.59k forks source link

Installing ray on powerpc #10774

Open rkube opened 4 years ago

rkube commented 4 years ago

Hi, not a bug report but a user history. I installed ray on our powerpc cluster. Since there are no wheels for this architecture I'm sharing my steps to get it running:

  1. Clone the git repository:

    $ git clone git@github.com:ray-project/ray.git
  2. py-spy has provides no wheels for powerpc. I had to install it and rust from source: Installing rust:

    $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    Add cargo, the rust package manager, to my PATH:

    $ export PATH=$PATH/.cargo/bin
  3. Install py-spy:

    $ cargo install py-spy

    See also https://github.com/benfred/py-spy/issues/277

  4. Then manually remove py-spy from requirements.txt and setup.py in ray

  5. I had to install bazel. The difficult part was to install JDK. Here the cluster support group helped me out and installed it system-wide

  6. Compile ray. Change directory (cd) into the git repo and follow the instruction to build from source

    $ cd ray/python
    pip install -e . --verbose  # Add --user if you see a permission denied error.

    I had to comment out the flag --experimental_ui_deduplicate in ray/.bazelrc to get it to compile, as this option has been removed in the bazel-3.5.0

  7. Now I can import ray and call ray.init() ray.shutdown() from python.

Hope this helps.

sumanthratna commented 4 years ago

thanks! this seems like something we should either mention in the docs or address in Ray's codebase. @rkube can you run ray's tests to see if anything breaks on powerpc? to test the python codebase just cd python and then run pytest

FarzanT commented 3 years ago

@rkube Thank you for your post, I'm trying to do the same but there is something wrong with the build. Here is the error stack:

    FAILED: Build did NOT complete successfully
    FAILED: Build did NOT complete successfully
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py", line 458, in <module>
        license="Apache 2.0") if __name__ == "__main__" else None
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/setuptools/command/develop.py", line 136, in install_for_development
        self.run_command('build_ext')
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py", line 421, in run
        return pip_run(self)
      File "/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py", line 338, in pip_run
        build(True, BUILD_JAVA)
      File "/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py", line 298, in build
        env=bazel_env)
      File "/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py", line 181, in bazel_invoke
        result = invoker([cmd] + cmdline, *args, **kwargs)
      File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/subprocess.py", line 363, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/home/l/lstein/ftaj/.bazel/bin/bazel', 'build', '--verbose_failures', '--', '//:ray_pkg']' returned non-zero exit status 1.
ERROR: Command errored out with exit status 1: /home/l/lstein/ftaj/.conda/envs/drp/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py'"'"'; __file__='"'"'/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 406, in run
    pycompile=options.compile,
  File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/pip/_internal/req/__init__.py", line 90, in install_given_reqs
    pycompile=pycompile,
  File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 800, in install
    unpacked_source_directory=self.unpacked_source_directory,
  File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/pip/_internal/operations/install/editable_legacy.py", line 51, in install_editable
    cwd=unpacked_source_directory,
  File "/home/l/lstein/ftaj/.conda/envs/drp/lib/python3.7/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /home/l/lstein/ftaj/.conda/envs/drp/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py'"'"'; __file__='"'"'/gpfs/fs1/home/l/lstein/ftaj/.conda/envs/drp/ray/python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
Removed build tracker: '/tmp/pip-req-tracker-ldq01835'

I have put Bazel binaries in /home/l/lstein/ftaj/.bazel/bin/bazel (renamed it from bazel_bin_ppc64le_3.7.0 to bazel). Any suggestion on how to fix the error?

Thanks!

ddelange commented 2 years ago

Duplicate of #2358