Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
f3982a9d
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
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看板
未验证
提交
f3982a9d
编写于
12月 13, 2022
作者:
Q
Qi Li
提交者:
GitHub
12月 13, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[NPU] fix FLAGS_npu_storage_format flag in python, test=develop (#48976)
上级
29d9dbe3
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
5 addition
and
14 deletion
+5
-14
paddle/phi/core/flags.cc
paddle/phi/core/flags.cc
+0
-2
python/paddle/fluid/dygraph/varbase_patch_methods.py
python/paddle/fluid/dygraph/varbase_patch_methods.py
+2
-3
python/paddle/nn/functional/conv.py
python/paddle/nn/functional/conv.py
+2
-6
python/paddle/nn/layer/norm.py
python/paddle/nn/layer/norm.py
+1
-3
未找到文件。
paddle/phi/core/flags.cc
浏览文件 @
f3982a9d
...
...
@@ -1040,7 +1040,6 @@ PADDLE_DEFINE_EXPORTED_string(jit_engine_type,
"Predictor"
,
"Choose default funciton type in JitLayer."
);
#ifdef PADDLE_WITH_CUSTOM_DEVICE
/**
* Custom Device NPU related FLAG
* Name: FLAGS_npu_storage_format
...
...
@@ -1050,7 +1049,6 @@ PADDLE_DEFINE_EXPORTED_string(jit_engine_type,
* Note: Enable NPU Storage Format for Ascend910 performance improvement.
*/
PADDLE_DEFINE_EXPORTED_bool
(
npu_storage_format
,
false
,
""
);
#endif
#ifdef PADDLE_WITH_CUDNN_FRONTEND
/**
...
...
python/paddle/fluid/dygraph/varbase_patch_methods.py
浏览文件 @
f3982a9d
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
inspect
import
numpy
as
np
import
warnings
...
...
@@ -42,6 +41,7 @@ import paddle.profiler as profiler
from
paddle.profiler.utils
import
in_profiler_mode
from
paddle
import
_C_ops
,
_legacy_C_ops
from
paddle.device
import
get_all_custom_device_type
from
paddle.fluid.framework
import
_global_flags
_grad_scalar
=
None
...
...
@@ -381,8 +381,7 @@ def monkey_patch_varbase():
new_ivar
=
self
.
_grad_ivar
()
# TODO(qili93): temporary for ascned npu performance to be removed along with npu_identity op
if
(
os
.
environ
.
get
(
'FLAGS_npu_storage_format'
,
None
)
in
[
1
,
'1'
,
True
,
'True'
,
'true'
]
_global_flags
()[
'FLAGS_npu_storage_format'
]
and
'npu'
in
get_all_custom_device_type
()
):
new_ivar
=
paddle
.
incubate
.
_npu_identity
(
x
=
new_ivar
,
format
=-
1
)
...
...
python/paddle/nn/functional/conv.py
浏览文件 @
f3982a9d
...
...
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
from
paddle
import
_C_ops
,
_legacy_C_ops
,
get_flags
,
in_dynamic_mode
from
paddle.device
import
(
get_all_custom_device_type
,
...
...
@@ -152,8 +150,7 @@ def _conv_nd(
bias
=
bias
.
reshape
(
new_shape
)
# TODO(qili93): temporary for ascned npu performance to be removed along with npu_identity op
if
(
os
.
environ
.
get
(
'FLAGS_npu_storage_format'
,
None
)
in
[
1
,
'1'
,
True
,
'True'
,
'true'
]
_global_flags
()[
'FLAGS_npu_storage_format'
]
and
'npu'
in
get_all_custom_device_type
()
):
with
no_grad
():
...
...
@@ -753,8 +750,7 @@ def conv2d(
)
# TODO(qili93): temporary for ascned npu performance to be removed along with npu_identity op
if
(
os
.
environ
.
get
(
'FLAGS_npu_storage_format'
,
None
)
in
[
1
,
'1'
,
True
,
'True'
,
'true'
]
_global_flags
()[
'FLAGS_npu_storage_format'
]
and
'npu'
in
get_all_custom_device_type
()
):
with
no_grad
():
...
...
python/paddle/nn/layer/norm.py
浏览文件 @
f3982a9d
...
...
@@ -28,7 +28,6 @@
# TODO: define normalization api
import
numbers
import
os
import
warnings
import
numpy
as
np
...
...
@@ -688,8 +687,7 @@ class _BatchNormBase(Layer):
# TODO(qili93): temporary for ascned npu performance to be removed along with npu_identity op
if
(
os
.
environ
.
get
(
'FLAGS_npu_storage_format'
,
None
)
in
[
1
,
'1'
,
True
,
'True'
,
'true'
]
_global_flags
()[
'FLAGS_npu_storage_format'
]
and
'npu'
in
get_all_custom_device_type
()
):
with
no_grad
():
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录