Skip to content

Commit

Permalink
ClPy v2.1.0a0
Browse files Browse the repository at this point in the history
  • Loading branch information
LWisteria committed Jun 7, 2018
1 parent 664ccee commit dec25c3
Show file tree
Hide file tree
Showing 398 changed files with 14,148 additions and 6,412 deletions.
23 changes: 23 additions & 0 deletions CONTRIBUTOR_CLPY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ClPy's contributors

Alphabetically sorted:

* Akira Tanaka (National Institute of Advanced Industrial Science and Technology)
* Kenjiro Taura (The University of Tokyo Taura Group)
* Naoki Yoshifuji (Fixstars Corporation)
* Naoya Sakabe (Fixstars Corporation)
* Ryousei Takano (National Institute of Advanced Industrial Science and Technology)
* Tomoya Sakai (Fixstars Corporation)
* Toru Asaka (Fixstars Corporation)
* Toru Fukaya (Fixstars Corporation)
* Tsutomu Ikegami (National Institute of Advanced Industrial Science and Technology)
* Yoriyuki Kitta (Fixstars Corporation)
* Yoshiki Imaizumi (Fixstars Corporation)
* Yuki Ito (Fixstars Corporation)
* Yuya Kawabata (Fixstars Corporation)

and [original cupy's contributors and others](https://github.com/fixstars/clpy/graphs/contributors).

## Acknowledgment

This work is partially based on results obtained from a project commissioned by the New Energy and Industrial Technology Development Organization (NEDO), Japan.
27 changes: 26 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
Copyright (c) 2018 The University of Tokyo Taura Group
Copyright (c) 2018 National Institute of Advanced Industrial Science and Technology
Copyright (c) 2018 Fixstars Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

######################################################################
# The ClPy is forked from CuPy Project.
######################################################################
Copyright (c) 2015 Preferred Infrastructure, Inc.
Copyright (c) 2015 Preferred Networks, Inc.

Expand All @@ -18,7 +43,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

######################################################################

######################################################################
# The CuPy is designed based on NumPy's API.
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
recursive-include cupy *.pyx *.pxd *.pxi *.h
include cupy_setup_build.py
recursive-include clpy *.pyx *.pxd *.pxi *.h
include clpy_setup_build.py
recursive-include install *.py
109 changes: 79 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,103 @@
<div align="center"><img src="docs/image/cupy_logo_1000px.png" width="400"/></div>
# ClPy: OpenCL backend for CuPy

# CuPy : NumPy-like API accelerated with CUDA
*ClPy* is an implementation of [CuPy](https://cupy.chainer.org/)'s OpenCL backend.
In other words, ClPy enables softwares written in CuPy to work also on OpenCL devices, not only on CUDA (NVIDIA) devices.

[![pypi](https://img.shields.io/pypi/v/cupy.svg)](https://pypi.python.org/pypi/cupy)
[![GitHub license](https://img.shields.io/github/license/cupy/cupy.svg)](https://github.com/cupy/cupy)
[![travis](https://img.shields.io/travis/cupy/cupy.svg)](https://travis-ci.org/cupy/cupy)
[![coveralls](https://img.shields.io/coveralls/cupy/cupy.svg)](https://coveralls.io/github/cupy/cupy)
[![Read the Docs](https://readthedocs.org/projects/cupy/badge/?version=stable)](https://docs-cupy.chainer.org/en/stable/)
## Current status

[**Website**](https://cupy.chainer.org/)
| [**Docs**](https://docs-cupy.chainer.org/en/stable/)
| [**Install Guide**](https://docs-cupy.chainer.org/en/stable/install.html)
| [**Tutorial**](https://docs-cupy.chainer.org/en/stable/tutorial/)
| **Examples** ([Official](https://github.com/cupy/cupy/blob/master/examples))
| **Forum** ([en](https://groups.google.com/forum/#!forum/cupy), [ja](https://groups.google.com/forum/#!forum/cupy-ja))
Current ClPy is alpha 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.

*CuPy* is an implementation of NumPy-compatible multi-dimensional array on CUDA.
CuPy consists of the core multi-dimensional array class, `cupy.ndarray`, and many functions on it.
It supports a subset of `numpy.ndarray` interface.
* 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
* Only SGEMM is supported in BLAS library
* Sparse matrix, dnn, rand libraries are not supported
* half and complex are not supported
* Works on only a single device
* No multiple command queue (Stream on CUDA)
* Dockerfile and some other files are just neglected thus don't work well

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).

## Recommended system

We develop and test ClPy in following environments.

* Primary machine
* OS: Ubuntu 16.04.4 LTS
* CPU: Core i7-4790
* GPU: AMD Radeon R9 Fury X
* SDK: AMD APP SDK 3.0
* Secondary machine
* OS: CentOS 7.2.1511
* CPU: Core i7-4790
* GPU: NVIDIA GeForce GTX 1060
* SDK: CUDA 9.2

We recommend those environments to all ClPy users. However, reports on other environments are welcome.

## Installation

For detailed instructions on installing CuPy, see [the installation guide](https://docs-cupy.chainer.org/en/stable/install.html).
First, 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.

You can install CuPy using `pip`:
For example with AMD APP SDK, you should set following environment variables:

```sh
$ pip install cupy
export C_INCLUDE_PATH=${C_INCLUDE_PATH}:${AMDAPPSDKROOT}/include
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:${AMDAPPSDKROOT}/include
export LIBRARY_PATH=${LIBRARY_PATH}:${AMDAPPSDKROOT}/lib/x86_64
```

Note that if you want to enable CUDA, cuDNN, and/or NCCL, they need to be set up before installation of CuPy.

## Run with Docker
and add ldconfig on `/etc/ldconf.so.d/` and `$ sudo ldconfig`.

We provide the official Docker image.
Use [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) command to run CuPy image with GPU.
You can login to the environment with bash, and run the Python interpreter.
After OpenCL is successfully installed, install ClPy.

```sh
$ pip install cython
$ python setup.py install
```
$ nvidia-docker run -it cupy/cupy /bin/bash

If you want `cupy` alias, set `export CLPY_GENERATE_CUPY_ALIAS=1` before 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 codes if you install with `CLPY_GENERATE_CUPY_ALIAS`.

### tests

```sh
$ pip install pytest
$ cd tests/you/want
$ python -m pytest test_you_want.py
```

## Development

Please see [the contribution guide](https://docs-cupy.chainer.org/en/stable/contribution.html).
1. All source codes (including comments) and commit messages should be written in English.
2. Issues and pull requests are welcome in any languages (recommended in English or Japanese).
3. Detailed coding styles are same as [CuPy's](https://docs-cupy.chainer.org/en/stable/contribution.html#coding-guidelines). Read and follow the guidelines before submitting PRs.

## Future plan

We are developing v0.2.1beta 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)
* -- and other functions and/or bug fixes that someone develops and/or requests..

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

- [Release notes](https://github.com/cupy/cupy/releases)
- [Projects using CuPy](https://github.com/cupy/cupy/wiki/Projects-using-CuPy)
Check github's issues and pull requests to get latest status.

## License

Expand Down
Loading

0 comments on commit dec25c3

Please sign in to comment.