Commit Graph

76 Commits

Author SHA1 Message Date
Margaret_wangrui 5c56a45cce Fixed the bug of cast eliminate. 2023-01-04 11:13:52 +08:00
chenfei e8a5637522 add scalar variable 2022-12-05 19:29:23 +08:00
i-robot bd3e498d2c
!46025 add grad nn ops bprop mindir
Merge pull request !46025 from lianliguang/bprop-mindir
2022-11-29 02:15:55 +00:00
luochao 605c1a8479 new_construct_bprop
move expander files
move expander component to mindspore/core
move the bprop expanders to mindspore/frontend
2022-11-27 04:55:01 -05:00
lianliguang bd4eea811b add nn_ops bprop mindir 2022-11-25 14:53:16 +08:00
i-robot 0245490acb
!43657 remove usage of ScalarToArray
Merge pull request !43657 from zhujingxuan/replace
2022-10-19 01:23:45 +00:00
i-robot d57236a794
!43038 change default mode to PyNative
Merge pull request !43038 from chujinjin/change_default_mode_to_pynative_for_master
2022-10-17 09:18:34 +00:00
zjun da1541e523 Fix grad param
Signed-off-by: zjun <zhangjun0@huawei.com>
2022-10-15 15:46:08 +08:00
chujinjin 3711a83f76 change default mode to pynative 2022-10-13 19:48:38 +08:00
zhujingxuan 1fd6d59f90 remove usage of ScalarToArray 2022-10-13 14:34:06 +08:00
i-robot 0e25f1e2fc
!40523 Change specialize order of graph nodes
Merge pull request !40523 from chenfei_mindspore/change-specialize-order
2022-08-27 08:34:08 +00:00
chenfei 8a2bea9f59 deplay specialize poly node if parent are not sepcialized 2022-08-26 11:10:29 +08:00
i-robot 606a988268
!40234 Optimiz no need grad node
Merge pull request !40234 from wanghenchang/mem-optimiz5
2022-08-16 08:29:08 +00:00
wangchangheng 3d09b8fbc2 optimiz no need grad net 2022-08-15 18:26:08 +08:00
chenzhuo 5f39ebd788 support grad and value_and_grad with has_aux 2022-08-12 16:43:03 +08:00
huangbingjian d6485b82f6 Remove support for dataclass 2022-04-24 09:12:50 +08:00
zhoufeng b7bb53ff73 build libmindspore_backend.so
Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
2022-03-17 19:14:45 +08:00
chenfei 3872e29c3b add ut for tuple trans 2022-03-16 21:33:54 +08:00
zhoufeng f49b195c39 extract common as an independent shared library
Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
2022-02-26 10:55:51 +08:00
chenfei a96f0b11e0 open closure 2022-01-28 22:04:31 +08:00
zhousiyi d9aa48bc64 Dont liftfv before grad in higher order grad if closure is kept as bprop of Partial primitive is not supported 2021-12-28 07:54:22 +00:00
zhangzhaoju 722086435d 1. fix:unexpected eiminate of tile
2. fix:delay memory allocat in NewTensorFilledWithData
2021-12-06 14:49:48 +08:00
lianliguang 0dc5d7f4f9 modify some eroor log and remove some useless code 2021-11-29 10:23:03 +08:00
He Wei 41dcac9c49 Replace std::unordered_map/set with robin-hood-hashing
Robin-hood-hashing (https://github.com/martinus/robin-hood-hashing)
is considered faster then std::unordered_map/set,
so we use it to improve mindspore performance.

1. robin_hood head file in `third_party/robin_hood/include`;
2. In `utils/hash_map.h` and `utils/hash_set.h`, we define:
 - mindspore::HashMap as an alias of robin_hood::unordered_map;
 - mindspore::HashSet as an alias of robin_hood::unordered_set;
3. Replace:
 - `#include <unordered_map>` --> `#include "utils/hash_map.h"`;
 - `#include <unordered_set>` --> `#include "utils/hash_set.h"`;
 - `std::unordered_map` --> `mindspore::HashMap`;
 - `std::unordered_set` --> `mindspore::HashSet`;
 - `map.insert(std::pair(key, value))` --> `map.emplace(key, value)`;
 - `[] (const std::pair<K, V> &p) {..} ` --> `[] (const auto &p) {..} `;
4. Fix issues found by switch to robin_hood:
 - AnfNodeConfig hash and equal;
 - Fix a bug in `Slice::operator==()`;
 - Fix a bug in `CNode::HasPrimalAttr()`;
 - Fix map.erase() usage bugs: `map.erase(iter++)` --> `iter = map.erase(iter)`;
 - Fix some iterator invalidated problem;
5. Some std::unordered_map/set can not replace by robin_hood:
 - As parameter of functions that exposed to python by pybind11;
 - Use bad hash that cause robin_hood::map over_flow, such as AbstractBasePtrListHasher;
6. Update cpp unit tests;
7. Add build option '-F' to enable robin_hood, default on.
2021-11-24 10:47:40 +08:00
zhang__sss 0dd68aa7eb grad 2021-11-11 23:18:35 +08:00
zhang__sss 8bae4d9d50 grad 2021-11-08 14:12:58 +08:00
huanghui ba66c0d491 add security isolate for save_graphs 2021-09-14 10:24:12 +08:00
zhousiyi a5b4e7bbf8 lift fv before grad except weight, then convert
switch(cond, partial(g1, xs), partial(g2, ys))(Zs)
 to
 switch(cond, g1, g2)(Xs, Ys, Zs)

 switch_layer(index, make_tuple(partial(g1, xs), partial(g2, ys)))(Zs)
 to
 switch_layer(index, make_tuple(g1, g2))(Xs, Ys, Zs)

put Zs at last when unifyparameter as it may have u-monad or io-monad

use joined args other than broadened one as some extra parameter which is not a parameter of while_header can be add to while_body

inline fprop_switch forcely

reorder the parameter if one of the parameter is Monad when incorporate call

incorporate switch tuple_getitem if item 0 of tuple is EnvInstance or
item 1 of tuple is bprop function

addn with shape() and shape(1)

remove context_ from FuncGraphEvaluator to make it re-entry able to resolve evaluator stuck issue because of re-entry of the same FuncGraphEvaluator
2021-07-03 00:03:37 +08:00
l00591931 0424b2d8d6 Fix warning in master 2021-06-04 17:40:01 +08:00
lvliang 116781041a fix ut compile failed 2021-05-19 19:59:10 +08:00
zhousiyi 4ff19b7082 add API to build bprop funcgraph which can be used for higher grad 2021-05-19 19:59:06 +08:00
lvliang c759effa94 fix_compile_ut_failed 2021-05-19 19:59:06 +08:00
zhousiyi 1843740e0d 1. set abstract for node. 2. Adjust the position of sens parameter from last to position just after Inputs. 3. Set debug name for Parameter 2021-05-19 19:58:51 +08:00
zhousiyi b40816e66a add support for stop_gradient primitive. And defer BackPropagation to End API 2021-05-19 19:58:49 +08:00
zhousiyi 0d6a5ccfe4 grad op for pynative 2021-05-19 19:58:46 +08:00
huangbingjian 134d5dfe4b separate irpass EnvGetItemEliminater and ItemTupleOrListEliminator 2021-04-02 17:38:40 +08:00
chenfei fc335daa30 get all j node and then expand them 2021-03-12 20:06:43 +08:00
yujianfeng f0b7c3dd4d Add a switch to control grad for scalar 2021-02-27 18:12:37 +08:00
yujianfeng 41189781f3 support scalar input for cell 2021-02-25 09:56:15 +08:00
buxue 6ccc4379b4 do not broaden scalar 2021-02-03 11:30:25 +08:00
zhouyuanshen d1e6878011 remove dot 2021-02-01 09:39:27 +08:00
buxue 2530943a7f optimize list getitem in bprop 2020-12-15 15:00:49 +08:00
yujianfeng 3176d377e6 Remove redundant phi nodes 2020-11-16 09:36:55 +08:00
Yi Huaijie d7faa77b5e support int64 shape 2020-11-05 21:15:49 +08:00
Hoai Linh Tran 46f07efc31 Fix AdjustAllReduceMulAdd pass
Revive tests in lib_test

Code cleaning
2020-09-19 01:07:01 -04:00
fary86 fcbb3e0edc Refactor ms_context implementation 2020-08-30 22:51:40 +08:00
zhousiyi c25e37e7bf make backend/optimizer pybind free 2020-08-28 08:56:58 +00:00
panyifeng 34e50e5d6e fix cell bprop 2020-08-07 10:57:01 +08:00
kingfo 28dabf0332 fix grad flag update issue in pynative 2020-08-06 15:12:31 +08:00
liubuyu a499d4e47c decoupling core and debug 2020-07-31 10:39:31 +08:00