From 75336d24990915d36743df496eb668bcf6454aa3 Mon Sep 17 00:00:00 2001 From: jiangcheng Date: Tue, 22 Nov 2022 18:03:59 +0800 Subject: [PATCH 1/5] fix paddle2cinn float16 type support bug --- paddle/fluid/framework/paddle2cinn/transform_type.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/framework/paddle2cinn/transform_type.cc b/paddle/fluid/framework/paddle2cinn/transform_type.cc index 60502edd99acf..747515f010d9d 100644 --- a/paddle/fluid/framework/paddle2cinn/transform_type.cc +++ b/paddle/fluid/framework/paddle2cinn/transform_type.cc @@ -58,6 +58,7 @@ ::phi::DataType TransToPaddleDataType(const cinn_type_t& type) { SET_TYPE_CASE_ITEM(cinn_int64_t, INT64) SET_TYPE_CASE_ITEM(cinn_uint32_t, UINT32) SET_TYPE_CASE_ITEM(cinn_uint64_t, UINT64) + SET_TYPE_CASE_ITEM(cinn_float16_t, FLOAT16) SET_TYPE_CASE_ITEM(cinn_float32_t, FLOAT32) SET_TYPE_CASE_ITEM(cinn_float64_t, FLOAT64) From d29780601d252931d8073b796a18f8de21970904 Mon Sep 17 00:00:00 2001 From: jiangcheng Date: Wed, 23 Nov 2022 14:37:08 +0800 Subject: [PATCH 2/5] update CINN tag from release/v0.2 to commit 34d9ef6 --- cmake/external/cinn.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/external/cinn.cmake b/cmake/external/cinn.cmake index c09ee715c3043..973fa593ee82c 100644 --- a/cmake/external/cinn.cmake +++ b/cmake/external/cinn.cmake @@ -17,7 +17,7 @@ if(NOT WITH_CINN) endif() if(NOT CINN_GIT_TAG) - set(CINN_GIT_TAG release/v0.2) + set(CINN_GIT_TAG 34d9ef6d7844b7b6561ce0b11c01b55f4858e3cb) endif() message(STATUS "CINN version: " ${CINN_GIT_TAG}) From 431e6cadcbc441e68c5d8ae692e2288fcc34dd53 Mon Sep 17 00:00:00 2001 From: jiangcheng Date: Wed, 7 Dec 2022 15:27:59 +0800 Subject: [PATCH 3/5] update cinn commit new --- cmake/external/cinn.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/external/cinn.cmake b/cmake/external/cinn.cmake index 973fa593ee82c..39f28bf62f334 100644 --- a/cmake/external/cinn.cmake +++ b/cmake/external/cinn.cmake @@ -17,7 +17,7 @@ if(NOT WITH_CINN) endif() if(NOT CINN_GIT_TAG) - set(CINN_GIT_TAG 34d9ef6d7844b7b6561ce0b11c01b55f4858e3cb) + set(CINN_GIT_TAG 357f5050e0ee3aed7278ccce08db90cf6826f987) endif() message(STATUS "CINN version: " ${CINN_GIT_TAG}) From c2161c8751c2a6e0e6054542907dae28aa8041b7 Mon Sep 17 00:00:00 2001 From: jiangcheng Date: Thu, 8 Dec 2022 11:34:22 +0800 Subject: [PATCH 4/5] add macro check for ci pass --- cmake/external/cinn.cmake | 2 +- paddle/fluid/framework/paddle2cinn/transform_type.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/external/cinn.cmake b/cmake/external/cinn.cmake index 39f28bf62f334..c09ee715c3043 100644 --- a/cmake/external/cinn.cmake +++ b/cmake/external/cinn.cmake @@ -17,7 +17,7 @@ if(NOT WITH_CINN) endif() if(NOT CINN_GIT_TAG) - set(CINN_GIT_TAG 357f5050e0ee3aed7278ccce08db90cf6826f987) + set(CINN_GIT_TAG release/v0.2) endif() message(STATUS "CINN version: " ${CINN_GIT_TAG}) diff --git a/paddle/fluid/framework/paddle2cinn/transform_type.cc b/paddle/fluid/framework/paddle2cinn/transform_type.cc index 747515f010d9d..49bd714af4a72 100644 --- a/paddle/fluid/framework/paddle2cinn/transform_type.cc +++ b/paddle/fluid/framework/paddle2cinn/transform_type.cc @@ -58,9 +58,11 @@ ::phi::DataType TransToPaddleDataType(const cinn_type_t& type) { SET_TYPE_CASE_ITEM(cinn_int64_t, INT64) SET_TYPE_CASE_ITEM(cinn_uint32_t, UINT32) SET_TYPE_CASE_ITEM(cinn_uint64_t, UINT64) - SET_TYPE_CASE_ITEM(cinn_float16_t, FLOAT16) SET_TYPE_CASE_ITEM(cinn_float32_t, FLOAT32) SET_TYPE_CASE_ITEM(cinn_float64_t, FLOAT64) +#ifdef CINN_CUDA_FP16 + SET_TYPE_CASE_ITEM(cinn_float16_t, FLOAT16) +#endif // CINN_CUDA_FP16 PADDLE_THROW(platform::errors::Unimplemented("Input type not supported yet")); return ::phi::DataType::UNDEFINED; From bf114a878e8641f3de91fd5c082023790045d4ef Mon Sep 17 00:00:00 2001 From: jiangcheng Date: Thu, 8 Dec 2022 14:15:02 +0800 Subject: [PATCH 5/5] change macro check from CINN_CUDA_FP16 to CINN_COMMON_FLOAT16_H --- paddle/fluid/framework/paddle2cinn/transform_type.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/paddle2cinn/transform_type.cc b/paddle/fluid/framework/paddle2cinn/transform_type.cc index 49bd714af4a72..c8172bd3f55f1 100644 --- a/paddle/fluid/framework/paddle2cinn/transform_type.cc +++ b/paddle/fluid/framework/paddle2cinn/transform_type.cc @@ -60,9 +60,9 @@ ::phi::DataType TransToPaddleDataType(const cinn_type_t& type) { SET_TYPE_CASE_ITEM(cinn_uint64_t, UINT64) SET_TYPE_CASE_ITEM(cinn_float32_t, FLOAT32) SET_TYPE_CASE_ITEM(cinn_float64_t, FLOAT64) -#ifdef CINN_CUDA_FP16 +#ifdef CINN_COMMON_FLOAT16_H SET_TYPE_CASE_ITEM(cinn_float16_t, FLOAT16) -#endif // CINN_CUDA_FP16 +#endif // CINN_COMMON_FLOAT16_H PADDLE_THROW(platform::errors::Unimplemented("Input type not supported yet")); return ::phi::DataType::UNDEFINED;