未验证 提交 1e981d0d 编写于 作者: H houj04 提交者: GitHub

[XPU] update xdnn to 0907. (#45777)

* [XPU] update xdnn to 0906. test=kunlun

* [XPU] update xdnn to 0907. test=kunlun
上级 9b70c556
...@@ -10,7 +10,7 @@ set(XPU_RT_LIB_NAME "libxpurt.so") ...@@ -10,7 +10,7 @@ set(XPU_RT_LIB_NAME "libxpurt.so")
if(NOT DEFINED XPU_BASE_URL) if(NOT DEFINED XPU_BASE_URL)
set(XPU_BASE_URL_WITHOUT_DATE set(XPU_BASE_URL_WITHOUT_DATE
"https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev") "https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev")
set(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220831") set(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220907")
else() else()
set(XPU_BASE_URL "${XPU_BASE_URL}") set(XPU_BASE_URL "${XPU_BASE_URL}")
endif() endif()
...@@ -19,7 +19,7 @@ endif() ...@@ -19,7 +19,7 @@ endif()
if(NOT DEFINED XPU_XDNN_BASE_URL) if(NOT DEFINED XPU_XDNN_BASE_URL)
set(XPU_XDNN_BASE_URL_WITHOUT_DATE set(XPU_XDNN_BASE_URL_WITHOUT_DATE
"https://klx-sdk-release-public.su.bcebos.com/xdnn/dev") "https://klx-sdk-release-public.su.bcebos.com/xdnn/dev")
set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220831") set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220907")
else() else()
set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL}") set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL}")
endif() endif()
......
...@@ -92,14 +92,14 @@ void RnnGradKernel(const Context& dev_ctx, ...@@ -92,14 +92,14 @@ void RnnGradKernel(const Context& dev_ctx,
std::vector<std::vector<const T*>> parameter_lists; std::vector<std::vector<const T*>> parameter_lists;
parameter_lists.resize(num_layers); parameter_lists.resize(num_layers);
reset_parameter_vector(weight_list, num_layers, is_bidirec, &parameter_lists); ResetParameterVector(weight_list, num_layers, is_bidirec, &parameter_lists);
for (unsigned int i = 0; i < weight_grad_list.size(); ++i) { for (unsigned int i = 0; i < weight_grad_list.size(); ++i) {
dev_ctx.template Alloc<T>(weight_grad_list[i]); dev_ctx.template Alloc<T>(weight_grad_list[i]);
} }
std::vector<std::vector<T*>> parameter_lists_grad; std::vector<std::vector<T*>> parameter_lists_grad;
parameter_lists_grad.resize(num_layers); parameter_lists_grad.resize(num_layers);
reset_parameter_vector( ResetParameterVector(
weight_grad_list, num_layers, is_bidirec, &parameter_lists_grad); weight_grad_list, num_layers, is_bidirec, &parameter_lists_grad);
// allocate the memory and initization the x_grad // allocate the memory and initization the x_grad
......
...@@ -89,7 +89,7 @@ void RnnKernel(const Context& dev_ctx, ...@@ -89,7 +89,7 @@ void RnnKernel(const Context& dev_ctx,
// weightlist // weightlist
std::vector<std::vector<const T*>> parameter_lists; std::vector<std::vector<const T*>> parameter_lists;
parameter_lists.resize(num_layers); parameter_lists.resize(num_layers);
reset_parameter_vector(weight_list, num_layers, is_bidirec, &parameter_lists); ResetParameterVector(weight_list, num_layers, is_bidirec, &parameter_lists);
// init the output and allocate the memory // init the output and allocate the memory
dev_ctx.template Alloc<T>(out); dev_ctx.template Alloc<T>(out);
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
namespace phi { namespace phi {
template <typename TensorType, typename T> template <typename TensorType, typename T>
void reset_parameter_vector(const std::vector<TensorType>& raw_params_vec, void ResetParameterVector(const std::vector<TensorType>& raw_params_vec,
const int& num_layers, const int& num_layers,
const bool& is_bidirec, const bool& is_bidirec,
std::vector<std::vector<T*>>* params_vec) { std::vector<std::vector<T*>>* params_vec) {
// the parameter raw seuquence is [FWhi, FWhh, BWhi, BWhh] * num_layers // the parameter raw seuquence is [FWhi, FWhh, BWhi, BWhh] * num_layers
// + [FBhi, FBhh, BBhi, BBhh] * num_layers, we will reset the parameter to // + [FBhi, FBhh, BBhi, BBhh] * num_layers, we will reset the parameter to
// ([FWhi, FWhh, FBhi, FBhh] + [BWhi, BWhh, BBhi, BBhh]) * num_layers // ([FWhi, FWhh, FBhi, FBhh] + [BWhi, BWhh, BBhi, BBhh]) * num_layers
......
...@@ -91,7 +91,10 @@ xpu_test_op_type_white_list = [ ...@@ -91,7 +91,10 @@ xpu_test_op_type_white_list = [
"lamb_float16", "lamb_float16",
"lars_momentum_float32", "lars_momentum_float32",
"resnet_unit", "resnet_unit",
"resnet_unit_grad" "resnet_unit_grad",
"c_embedding_float32", # unittests of collective ops do not using xpu testing framework
"c_sync_comm_stream_float32",
"c_sync_calc_stream_float32",
] ]
xpu_test_device_op_white_list = [] xpu_test_device_op_white_list = []
xpu_test_device_op_type_white_list = [] xpu_test_device_op_type_white_list = []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册