Commit Graph

22 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
zhousiyi 19e9571149 rename env_getitem/setitem to EnvironGet/EnvironGet 2022-01-04 02:17:30 +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
lianliguang 4d7b7649e9 remove the useless PrimType 2021-04-20 10:16:36 +08:00
dingpeifei 87e41aaeee IR operators of GPU and CPU are unified as batchnorm 2021-03-18 19:02:28 +08:00
l00591931 bbdb050fc7 Change switch to Switch 2021-03-11 17:06:55 +08:00
l00591931 680324f225 Change make tuple in core.ops 2021-03-05 10:54:33 +08:00
l00591931 cf7c5840e3 Change return 2021-03-04 09:38:43 +08:00
mindspore-ci-bot b189f177bb Change tuple_getitem to TupleGetItem and some other ops, merge from r1.1 to master 2021-02-02 15:54:15 +08:00
zhouyuanshen d1e6878011 remove dot 2021-02-01 09:39:27 +08:00
Yi Huaijie d7faa77b5e support int64 shape 2020-11-05 21:15:49 +08:00
zhousiyi d0e58dd765 remove ccsrc/common.h
replace frontend/operator/ops.h in backend with base/core_ops.h as
backend should not use any frontend-only primitive
2020-08-20 09:34:07 +00:00
liubuyu 45b6600001 mv cc file that end with py to pybind 2020-08-12 14:50:18 +08:00
buxue b075674cf2 support tensor attr shape and dtype in graph mode 2020-08-03 17:09:31 +08:00
liubuyu f4bc0bc9fe move the dependency of utils to core 2020-07-27 10:28:46 +08:00
WilliamLian 50e2fda52d refactor primitive ComputeFunction function 2020-07-16 14:36:04 +08:00
liubuyu 43c79eb853 mindspore path adjust 2020-07-14 18:07:28 +08:00
WilliamLian 9682d08d96 refactor primitive hook function 2020-07-13 17:27:39 +08:00
kingfo 38436f929f move hook function to primtivePy class 2020-06-10 15:33:46 +08:00
leopz 4508134ceb add tensor_minnie and separate py from ir 2020-05-28 14:26:26 +08:00
leopz 04763b8b76 move signature to primitivepy and bprop_func to utils 2020-05-20 18:06:36 +08:00
zhunaipan 930a1fb0a8 initial version
Signed-off-by: leonwanghui <leon.wanghui@huawei.com>
2020-03-27 22:54:54 +08:00