8000 GitHub - Oneflow-Inc/oneflow-mlu
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Oneflow-Inc/oneflow-mlu

Repository files navigation

oneflow-mlu

OneFlow-MLU is an OneFlow extension that enables oneflow to run on the Cambricon MLU chips. Currently it only supports the MLU 370 series.

Installation

pip

TODO

Building From Source

Prerequisites

Get the OneFlow-MLU Source

git clone https://github.com/Oneflow-Inc/oneflow-mlu

Building

Inside OneFlow-MLU source directory, then run the following command to build and install oneflow_mlu,

python3 setup.py install

Run A Toy Program

# python3

>>> import oneflow as flow
>>> import oneflow_mlu
>>>
>>> m = flow.nn.Linear(3, 4).to("mlu")
>>> x = flow.randn(4, 3, device="mlu")
>>> y = m(x)
>>> print(y)
tensor([[ 0.4239, -0.4689, -0.1660,  0.0718],
        [ 0.5413,  1.9006,  2.0763,  0.8693],
        [ 0.4226, -0.0207,  0.1006,  0.2234],
        [ 0.4054, -0.2816, -0.4405,  0.1099]], device='mlu:0', dtype=oneflow.float32, grad_fn=<broadcast_addBackward>)

Models

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 22

0