Skip to content

Commit

Permalink
Revert "use flat_hash_map and small_vector in kernel factory"
Browse files Browse the repository at this point in the history
This reverts commit 2309149.
  • Loading branch information
chenwhql committed Oct 15, 2021
1 parent 6ce92e5 commit e0322d5
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions paddle/tcmpt/core/kernel_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

#include <ostream>
#include <string>
#include <unordered_map>
#include <utility>

#include "paddle/tcmpt/core/backend.h"
#include "paddle/tcmpt/core/dtype.h"
#include "paddle/tcmpt/core/kernel_def.h"
#include "paddle/tcmpt/core/layout.h"
#include "paddle/utils/flat_hash_map.h"
#include "paddle/utils/small_vector.h"

// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/platform/enforce.h"
Expand Down Expand Up @@ -210,30 +209,25 @@ class KernelArgsDef {
attribute_defs_.emplace_back(AttributeArgDef(type_index));
}

const paddle::SmallVector<TensorArgDef>& input_defs() const {
return input_defs_;
}
const std::vector<TensorArgDef>& input_defs() const { return input_defs_; }

const paddle::SmallVector<TensorArgDef>& output_defs() const {
return output_defs_;
}
const std::vector<TensorArgDef>& output_defs() const { return output_defs_; }

const paddle::SmallVector<AttributeArgDef>& attribute_defs() const {
const std::vector<AttributeArgDef>& attribute_defs() const {
return attribute_defs_;
}

paddle::SmallVector<TensorArgDef>& input_defs() { return input_defs_; }
std::vector<TensorArgDef>& input_defs() { return input_defs_; }

paddle::SmallVector<TensorArgDef>& output_defs() { return output_defs_; }
std::vector<TensorArgDef>& output_defs() { return output_defs_; }

paddle::SmallVector<AttributeArgDef>& attribute_defs() {
return attribute_defs_;
}
std::vector<AttributeArgDef>& attribute_defs() { return attribute_defs_; }

private:
paddle::SmallVector<TensorArgDef> input_defs_{{}};
paddle::SmallVector<TensorArgDef> output_defs_{{}};
paddle::SmallVector<AttributeArgDef> attribute_defs_{{}};
// TODO(chenweihang): replaced by paddle::small_vector
std::vector<TensorArgDef> input_defs_{{}};
std::vector<TensorArgDef> output_defs_{{}};
std::vector<AttributeArgDef> attribute_defs_{{}};
};

class Kernel {
Expand Down Expand Up @@ -269,10 +263,10 @@ class Kernel {
class KernelFactory {
public:
// replaced by paddle::flat_hash_map later
using KernelMap = paddle::flat_hash_map<
KernelName,
paddle::flat_hash_map<KernelKey, Kernel, KernelKey::Hash>,
KernelName::Hash>;
using KernelMap =
std::unordered_map<KernelName,
std::unordered_map<KernelKey, Kernel, KernelKey::Hash>,
KernelName::Hash>;

static KernelFactory& Instance();

Expand Down

1 comment on commit e0322d5

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on e0322d5 Oct 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #34425 Commit ID: e0322d5 contains failed CI.

🔹 Failed: PR-CI-APPROVAL

approve_failed
2021-10-15 15:09:34 正在保存至: “bk.txt”
2021-10-15 15:09:34 0K 100% 3.03M=0s
2021-10-15 15:09:34 2021-10-15 15:09:34 (3.03 MB/s) - 已保存 “bk.txt” [5/5])
2021-10-15 15:09:42 ****************
2021-10-15 15:09:42 0. You must have one RD (lanxianghit (Recommend), phlrain or luotao1) approval for changing the FLAGS, which manages the environment variables.
2021-10-15 15:09:42 1. You must have Dianhai approval for change 20+ files or add than 1000+ lines of content.
2021-10-15 15:09:42 2. You must have one RD (XiaoguangHu01,chenwhql,zhiqiu,Xreki,luotao1) approval for paddle/fluid/framework/operator.h, which manages the underlying code for fluid.
2021-10-15 15:09:42 3. You must have one RD (zhiqiu (Recommend) , phlrain) approval for the changes of paddle/fluid/pybind/op_function_generator.cc, which manages the logic of automatic generating op functions for dygraph.
2021-10-15 15:09:42 4. You must have one RD (XiaoguangHu01,chenwhql,zhiqiu,Xreki,luotao1) approval for the usage of const_cast.
2021-10-15 15:09:42 5. You must have one RD (Avin0323(Recommend) or zhouwei25 or wanghuancoder or luotao1) approval for modifying unity_build_rule.cmake which the rules of Unity Build.
2021-10-15 15:09:42 There are 6 approved errors.
2021-10-15 15:09:42 ****************
2021-10-15 15:09:42 + EXCODE=6
2021-10-15 15:09:42 + echo 'EXCODE: 6'
2021-10-15 15:09:42 EXCODE: 6
2021-10-15 15:09:42 + echo 'ipipe_log_param_EXCODE: 6'
2021-10-15 15:09:42 ipipe_log_param_EXCODE: 6
2021-10-15 15:09:42 + exit 6

🔹 Failed: PR-CI-OP-benchmark

Unknown Failed
2021-10-15 16:49:12 + echo '[tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "mean"(paddle/fluid/operators/mean_op.cu) in benchmark.'
2021-10-15 16:49:12 [tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "mean"(paddle/fluid/operators/mean_op.cu) in benchmark.
2021-10-15 16:49:12 + for op_name in '${!CHANGE_OP_MAP[@]}'
2021-10-15 16:49:12 + '[' -z '' ']'
2021-10-15 16:49:12 + exit_code=8
2021-10-15 16:49:12 + LOG '[ERROR] Missing test script of "fill_any_like"(paddle/fluid/operators/fill_any_like_op.cu) in benchmark.'
2021-10-15 16:49:12 + echo '[tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "fill_any_like"(paddle/fluid/operators/fill_any_like_op.cu) in benchmark.'
2021-10-15 16:49:12 [tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "fill_any_like"(paddle/fluid/operators/fill_any_like_op.cu) in benchmark.
2021-10-15 16:49:12 + for op_name in '${!CHANGE_OP_MAP[@]}'
2021-10-15 16:49:12 + '[' -z matmul,matmul,matmul.json,True ']'
2021-10-15 16:49:12 + '[' 8 -ne 0 ']'
2021-10-15 16:49:12 + LOG '[INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.'
2021-10-15 16:49:12 + echo '[tools/test_ci_op_benchmark.sh:275] [INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.'
2021-10-15 16:49:12 [tools/test_ci_op_benchmark.sh:275] [INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.
2021-10-15 16:49:12 + LOG '[INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.'
2021-10-15 16:49:12 + echo '[tools/test_ci_op_benchmark.sh:276] [INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.'
2021-10-15 16:49:12 [tools/test_ci_op_benchmark.sh:276] [INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.
2021-10-15 16:49:12 + exit 8
2021-10-15 16:49:12 {build code state=8}

🔹 Failed: PR-CE-Framework

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Coverage

coverage_failed
2021-10-15 18:10:51 + CURL_OPTS='-s --connect-timeout 600 --retry 10 --retry-delay 10'
2021-10-15 18:10:51 ++ uuid
2021-10-15 18:10:51 ++ curl -s --connect-timeout 600 --retry 10 --retry-delay 10 -u paddle:915eedab953b6f51151f50eb https://xly.bce.baidu.com/ipipe/ipipe-report/uuid
2021-10-15 18:10:51 + UPLOAD_FILE=/tmp/upload-96fe273d-c870-4ba1-85cb-ce9acdb2d091.tar.gz
2021-10-15 18:10:51 + echo Archiving
2021-10-15 18:10:51 Archiving
2021-10-15 18:10:51 + tar -czvf /tmp/upload-96fe273d-c870-4ba1-85cb-ce9acdb2d091.tar.gz .
2021-10-15 18:10:51 ./
2021-10-15 18:10:51 + du -hs /tmp/upload-96fe273d-c870-4ba1-85cb-ce9acdb2d091.tar.gz
2021-10-15 18:10:51 4.0K /tmp/upload-96fe273d-c870-4ba1-85cb-ce9acdb2d091.tar.gz
2021-10-15 18:10:51 + curl -s --connect-timeout 600 --retry 10 --retry-delay 10 -u paddle:915eedab953b6f51151f50eb -F buildId=8344911 -F path=python-coverage -F file=@/tmp/upload-96fe273d-c870-4ba1-85cb-ce9acdb2d091.tar.gz https://xly.bce.baidu.com/ipipe/ipipe-report/upload
2021-10-15 18:10:52 + rm -f /tmp/upload-96fe273d-c870-4ba1-85cb-ce9acdb2d091.tar.gz
2021-10-15 18:10:52 report uploaded
2021-10-15 18:10:52 9
2021-10-15 18:10:52 ipipe_log_param_EXCODE: 9
2021-10-15 18:10:52 Sorry, coverage check failed.
2021-10-15 18:10:52 + exit 9
2021-10-15 18:10:52 {build code state=9}
2021-10-15 18:11:02 kill agent BUILD_CODE_FAIL

Please sign in to comment.