Commit Graph

16 Commits

Author SHA1 Message Date
haoran.wang 3674e1d713 Add Mem & Redis coefficient for PanGu-alpha 2022-03-29 12:00:34 +00: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
Xiaoda Zhang 5fecfe92a6 code style warnings fixing 2021-04-27 19:54:56 +08:00
Xiaoda Zhang 3c27c08b46 change memory cost calculation in auto-parallel 2020-12-28 14:38:30 +08:00
Yi Huaijie d7faa77b5e support int64 shape 2020-11-05 21:15:49 +08:00
Yi Huaijie 518cb80133 change type of Shape from int32 to int64 2020-08-04 11:30:23 +08:00
suteng 19e45ccdb1 回退 'Pull Request !3103 : change type of Shape from int32 to int64' 2020-08-03 22:06:37 +08:00
Yi Huaijie 15d5cc396d change type of Shape from int32 to int64 2020-08-03 16:47:19 +08:00
liubuyu 43c79eb853 mindspore path adjust 2020-07-14 18:07:28 +08:00
leopz 40e15996b0 move default_param out of parameter and remove pybind11 in anf define 2020-05-19 19:11:12 +08:00
Xiaoda Zhang def8573275 implementing-searching-strategy-for-inference 2020-05-07 14:53:50 +08:00
ch-l f806b72447 use DeviceMemory for memory control 2020-04-23 17:55:17 +08:00
c00425699 d62f560b50 add_bool_type_check_in_comm_op 2020-04-13 17:34:29 +08:00
Xiaoda Zhang a153fad874 This commit is to separate the computation cost and memory cost in auto_parallel. Some related memory correction is removed. 2020-04-08 11:52:19 +08:00
c00425699 3bb48ffee1 use std::vector instead of std::list to promote performance for parallel module 2020-03-31 15:16:00 +08:00
zhunaipan 930a1fb0a8 initial version
Signed-off-by: leonwanghui <leon.wanghui@huawei.com>
2020-03-27 22:54:54 +08:00