add mindspore support#193
Conversation
|
@arogozhnikov hello sir, I have committed a merge request for adding a new backend named MindSpore, which is a new DL framework. Would please review this pr and give some comments or merge it if no problems? |
|
Hi @lvyufeng thanks for a well-organized PR. Github CI does not have cuda, so effectively tests were turned off in your branch. I've modified it to include tests (but skip einsum) and run on linux. Result is:
you can see error here in the log: https://github.com/arogozhnikov/einops/runs/7266742212?check_suite_focus=true here is the branch that includes your code and my change to turn tests on: https://github.com/arogozhnikov/einops/tree/mindspore-show-issue |
|
It looks like a bug on CPU platform, I will check it and try to fix it. BTW, I remember the |
|
it seems that only from mindspore import context
context.set_context(mode=context.PYNATIVE_MODE)BTW, mindspore will set |
|
the error has been fixed. |
|
@arogozhnikov the error has been fixed, would you please review the code and merge it? |
| def __init__(self): | ||
| super().__init__() | ||
| import mindspore as ms | ||
| ms.set_context(mode=ms.PYNATIVE_MODE) |
There was a problem hiding this comment.
Can we use GRAPH_MODE right now ? it seems the very important identity feature in MindSpore.
Thoes who use MindSpore would like to try the jit accelerator.
There was a problem hiding this comment.
Some pythonic code style or specific grammar is not supported on GRAPH_MODE, like try...except, so I have to change the default mode to PYNATIVE. BTW, MindSpore plans to set PYNATIVE mode to support flexible writing, and partial accelerating can use mindspore.ms_function.
here is a simple case:
from mindspore import ms_function
from mindspore import nn
class TestNet(nn.Cell):
def __init__():
super().__init__():
self.net = nn.Dense(30, 40)
@ms_function
def construct(self, x)
return self.net(x)|
This feature hasn't been merged yet? |
|
Einops does not accept new backends, those require sufficient time for maintenance. Lib authors can implement array api: Array api support will be available in einops 0.7 Relevant PR: #261 |
Add mindspore deep learning framework support.