einops icon indicating copy to clipboard operation
einops copied to clipboard

add mindspore support

Open lvyufeng opened this issue 2 years ago • 5 comments

Add mindspore deep learning framework support.

lvyufeng avatar Jun 22 '22 16:06 lvyufeng

@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?

lvyufeng avatar Jul 06 '22 08:07 lvyufeng

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:

  • ops are working
  • but layers are failing with quite a strange error,

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

arogozhnikov avatar Jul 09 '22 22:07 arogozhnikov

It looks like a bug on CPU platform, I will check it and try to fix it. BTW, I remember the mindspore-gpu package i used was a development version, which is a daily compiled package, maybe the bug had beed fixed in MindSpore 1.8(which is released at July 26).

lvyufeng avatar Jul 27 '22 11:07 lvyufeng

it seems that only Pynative mode works well, you should add the following code snippet:

from mindspore import context
context.set_context(mode=context.PYNATIVE_MODE)

BTW, mindspore will set Pynative mode as the default running mode since 1.9.0.

lvyufeng avatar Sep 05 '22 12:09 lvyufeng

the error has been fixed.

lvyufeng avatar Sep 05 '22 13:09 lvyufeng

@arogozhnikov the error has been fixed, would you please review the code and merge it?

lvyufeng avatar Sep 25 '22 12:09 lvyufeng

This feature hasn't been merged yet?

jiangxiluning avatar Jul 06 '23 04:07 jiangxiluning

Einops does not accept new backends, those require sufficient time for maintenance.

Lib authors can implement array api: https://data-apis.org/array-api/latest/API_specification/index.html and einops.array_api will immediately work for them.

Array api support will be available in einops 0.7

Relevant PR: #261

arogozhnikov avatar Jul 07 '23 19:07 arogozhnikov