Commit Graph

14 Commits

Author SHA1 Message Date
zhoufeng f49b195c39 extract common as an independent shared library
Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
2022-02-26 10:55:51 +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
lianliguang dd57fcf8d7 add funcgraph py dump and dump more info for dynamic shape 2021-07-23 10:30:27 +08:00
Zhang Qinghua f7ffc03249 Dump func graph where to call the node. 2021-07-09 21:37:48 +08:00
lanzhineng fc8ec7fc49 infer_optv3:infer optimize to find exit of branches and resolve the
endless issue.
2021-06-22 11:55:56 +08:00
lianliguang e3d7304208 add function to remove monad abs when using cpp infer 2021-05-21 17:02:52 +08:00
lianliguang d2c696667b change process of infer value 2021-04-20 19:02:22 +08:00
LianLiguang bdc21bcf3e change infer value 2021-04-12 20:38:10 +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
Yi Huaijie d7faa77b5e support int64 shape 2020-11-05 21:15:49 +08:00
liubuyu 43c79eb853 mindspore path adjust 2020-07-14 18:07:28 +08:00
Zhang Qinghua 87715ed127 Refactoring for base and abstract types: Moving Base into base folder; Splitting the abstract type and infer&specialize routines; 2020-07-14 09:38:00 +08:00