Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
35839aee
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
35839aee
编写于
8月 10, 2022
作者:
C
Chen Weihang
提交者:
GitHub
8月 10, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polish backend and layout details (#45029)
上级
083b4eb6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
3 deletion
+19
-3
paddle/phi/common/backend.h
paddle/phi/common/backend.h
+1
-2
paddle/phi/common/layout.h
paddle/phi/common/layout.h
+18
-1
未找到文件。
paddle/phi/common/backend.h
浏览文件 @
35839aee
...
@@ -48,6 +48,7 @@ enum class Backend : uint8_t {
...
@@ -48,6 +48,7 @@ enum class Backend : uint8_t {
XPU
,
// XPU currently does not exist at the same time as CUDA
XPU
,
// XPU currently does not exist at the same time as CUDA
NPU
,
// NPU currently does not exist at the same time as CUDA
NPU
,
// NPU currently does not exist at the same time as CUDA
MLU
,
// MLU currently does not exist at the same time as CUDA
MLU
,
// MLU currently does not exist at the same time as CUDA
IPU
,
// the third library backend
// the third library backend
ONEDNN
,
ONEDNN
,
...
@@ -56,8 +57,6 @@ enum class Backend : uint8_t {
...
@@ -56,8 +57,6 @@ enum class Backend : uint8_t {
// paddle kernel primitives backend
// paddle kernel primitives backend
KPS
,
KPS
,
IPU
,
// end of backend types
// end of backend types
NUM_BACKENDS
,
NUM_BACKENDS
,
...
...
paddle/phi/common/layout.h
浏览文件 @
35839aee
...
@@ -18,8 +18,20 @@ limitations under the License. */
...
@@ -18,8 +18,20 @@ limitations under the License. */
namespace
paddle
{
namespace
paddle
{
namespace
experimental
{
namespace
experimental
{
// Note: The original design of paddle DataLayout is confusing.
// It contains two levels of "layout", one is the data layout
// at the Tensor level, including Dense, Sparse, etc., and the other
// is the format at the data level, including NHWC, NCHW, etc.,
// these should belong to the concept of "data format".
// The concepts of these two levels are mixed into an enumeration class,
// which leads to some strange execution scheduling logic.
// It needs to be refactored in the future.
// In order to maintain compatibility, we still use the design of the
// original framework here.
// Note: Here the DataLayout is public api for external users, the prefix `k`
// Note: Here the DataLayout is public api for external users, the prefix `k`
// maybe confuse users, so we use all uppercase names
// maybe confuse users, so we use all uppercase names
enum
class
DataLayout
{
enum
class
DataLayout
{
UNDEFINED
=
0
,
UNDEFINED
=
0
,
// TODO(chenweihang): keep ANY for compatibility, remove it later
// TODO(chenweihang): keep ANY for compatibility, remove it later
...
@@ -32,16 +44,21 @@ enum class DataLayout {
...
@@ -32,16 +44,21 @@ enum class DataLayout {
SPARSE_COO
,
SPARSE_COO
,
SPARSE_CSR
,
SPARSE_CSR
,
PSTRING_UNION
,
PSTRING_UNION
,
NUM_DATA_LAYOUTS
,
NUM_DATA_LAYOUTS
,
// See Note [ Why we need ALL in basic kernel key member? ]
// See Note [ Why we need ALL in basic kernel key member? ]
ALL_LAYOUT
=
UNDEFINED
,
ALL_LAYOUT
=
UNDEFINED
,
// Note: Unify phi DataLayout and fluid::framework::DataLayout,
// Note: Unify phi DataLayout and fluid::framework::DataLayout,
// for compatible with fluid DataLayout, here need prefix `k`
// for compatible with fluid DataLayout, here need prefix `k`
// Note: The original `kAnyLayout (enum value 2)` is a strange design.
// Note: The original `kAnyLayout (enum value 2)` is a strange design.
// `kAnyLayout` originally cannot represent any kind of Layout,
// `kAnyLayout` originally cannot represent any kind of Layout,
// at the same time, it can also represent any Layout.
// at the same time, it can also represent any Layout.
// Strictly, it means "default" or "undefined" layout,
// Strictly, it means "default" or "undefined" layout,
// and should not be mixed with other meaningful layouts.
// and should not be mixed with other meaningful layouts
kAnyLayout
=
ANY
,
kAnyLayout
=
ANY
,
kNHWC
=
NHWC
,
kNHWC
=
NHWC
,
kNCHW
=
NCHW
,
kNCHW
=
NCHW
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录