Skip to content

Commit

Permalink
Merge pull request #57 from fixstars/45-v2.1.0beta0
Browse files Browse the repository at this point in the history
Update readme and versions for v2.1.0beta
  • Loading branch information
neko-suki authored Aug 22, 2018
2 parents 8ba915f + 9c3e85e commit 0bdaa05
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ In other words, ClPy enables softwares written in CuPy to work also on OpenCL de

## Current status

Current ClPy is alpha version, forked from [CuPy v2.1.0](https://github.com/cupy/cupy/releases/tag/v2.1.0).
Current ClPy is beta version, forked from [CuPy v2.1.0](https://github.com/cupy/cupy/releases/tag/v2.1.0).
ClPy is still under development and works on only limited APIs.

* Basic [ndarray](https://docs-cupy.chainer.org/en/stable/reference/ndarray.html) are supported, but not perfectly
* Basic [universal functions](https://docs-cupy.chainer.org/en/stable/reference/ufunc.html) are supported, but not perfectly
* Simple [custom kernels](https://docs-cupy.chainer.org/en/stable/reference/kernel.html) are supported, but some custom kernel codes might be fail to compile and/or run
* Most of [custom kernels](https://docs-cupy.chainer.org/en/stable/reference/kernel.html) are supported, but some custom kernel codes might be fail to compile and/or run
* Only SGEMM is supported in BLAS library
* Sparse matrix, dnn, rand libraries are not supported
* half and complex are not supported
Expand All @@ -21,7 +21,7 @@ ClPy is still under development and works on only limited APIs.
Original CuPy's tests are not passed perfectly. See current [CuPy's test and example results](https://github.com/fixstars/ClPy/wiki/cupy_test_example_results).

[Chainer](https://chainer.org/) works with limited situation.
Very simple and small examples are confirmed to work. See current [Chainer's test and example results](https://github.com/fixstars/ClPy/wiki/chainer_test_example_results).
Some examples are confirmed to work. See current [Chainer's test and example results](https://github.com/fixstars/ClPy/wiki/chainer_test_example_results).

## Recommended system

Expand All @@ -42,7 +42,10 @@ We recommend those environments to all ClPy users. However, reports on other env

## Installation

First, install and setup OpenCL environment.
### Setup OpenCL

Install and setup OpenCL environment.

`cl.h` and OpenCL libs (`libOpenCL.so`) must be able to be included and linked without any special path settings.

For example with AMD APP SDK, you should set following environment variables:
Expand All @@ -55,7 +58,8 @@ export LIBRARY_PATH=${LIBRARY_PATH}:${AMDAPPSDKROOT}/lib/x86_64

and add ldconfig on `/etc/ldconf.so.d/` and `$ sudo ldconfig`.

Second, install LLVM/Clang.
### Install LLVM/Clang

Current ClPy requires LLVM/Clang 4.0, 5.0, or 6.0.
We **strongly** recommend that you build LLVM/Clang from the source codes and install it.
However, at least in Ubuntu 16.04, you can use the LLVM/Clang from the Ubuntu official package repository.
Expand All @@ -67,6 +71,8 @@ $ export PATH=/usr/lib/llvm-6.0/bin:$PATH
$ export CPLUS_INCLUDE_PATH=/usr/lib/llvm-6.0/include:$CPLUS_INCLUDE_PATH
```

### Install ClPy

After OpenCL and LLVM/Clang is successfully installed, install ClPy.

```console
Expand All @@ -76,15 +82,15 @@ $ python setup.py install

## How to use

Just replace `cupy` to `clpy` in your python codes and run it (e.g. `import cupy` -> `import clpy`).

You don't need to replace all cuda imports, if you add `import clpy` before `import cupy` in your python codes.
(`import clpy` add import hook. The hook will import clpy when `imoprt cupy` is called.)
If you want to switch clpy and cupy without changing source code,
set `export CLPY_NOT_HOOK_CUPY=1` before execution and disable hook.
Run your CuPy code with `-m clpy` option ( e.g. `python -m clpy /path/to/chainer/examples/mnist/train_mnist.py -g0`).
This option adds aliases to CuPy by hooking `import cupy` and call ClPy through `cupy.foobar`.
You don't need to modify any your codes.

Or you don't need to replace any codes, if you run your python code with `-m clpy` option ( e.g. `python -m clpy /path/to/chainer/examples/mnist/train_mnist.py -g0`).
If you don't want to run with `-m` option, you must add `import clpy` before `import cupy` in your codes.
`import clpy` adds the aliases same as `-m clpy`.

If you want to disable such aliases, set `export CLPY_NOT_HOOK_CUPY=1` before execution.
Then, you need to replace `cupy` to `clpy` in your all codes (e.g. `import cupy` -> `import clpy`).

### Woking with Chainer

Expand All @@ -106,19 +112,17 @@ $ python -m pytest test_you_want.py

## Future plan

We are developing v0.2.1beta for next release.
We are developing v0.2.1beta1 for next release.

* Support Chainer's ImageNet example
* OpenCL version check and auto generated `api.pxd` from `cl.h` in the system
* Map buffer for host memory
* Support all BLAS API
* Improve `cupy` aliasing mechanism
* Update recommended system (Vega and Volta)
* Support all BLAS APIs and accelerate them
* Multiple devices
* Multiple CommandQueue (Stream)
* -- and other functions and/or bug fixes that someone develops and/or requests..

We also plan to update CuPy's base version to v4 or v5 after above beta release.
We also plan to update CuPy's base version to v4 or v5 after beta release.

Check github's issues and pull requests to get latest status.
Check [github's issues and pull requests ](https://github.com/fixstars/clpy/issues) to get latest status.

## License

Expand Down
2 changes: 1 addition & 1 deletion clpy/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.1.0a0'
__version__ = '2.1.0b0'

0 comments on commit 0bdaa05

Please sign in to comment.