Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

昇腾和寒武纪相关代码退场 npu相关代码退场3 #53699

Merged
merged 20 commits into from
May 16, 2023

Conversation

Liyulingyue
Copy link
Contributor

@Liyulingyue Liyulingyue commented May 10, 2023

PR types

Others

PR changes

Others

Description

#52319

@paddle-bot
Copy link

paddle-bot bot commented May 10, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels May 10, 2023
@paddle-bot
Copy link

paddle-bot bot commented May 10, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

Copy link
Contributor

@KimBioInfoStudio KimBioInfoStudio left a comment

Choose a reason for hiding this comment

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

is_compiled_with_custom_device('npu')if...else... 请两位 看下是否合适现阶段就去掉 @ronny1996 @zhiqiu

l_type = 'depthwise_conv2d'
else:
l_type = 'conv2d'

Copy link
Contributor

Choose a reason for hiding this comment

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

@ronny1996 any comment?

@@ -97,8 +97,6 @@ def _get_sys_unsupported_list(dtype):
device = None
if core.is_compiled_with_xpu():
device = 'XPU'
elif core.is_compiled_with_custom_device('npu'):
Copy link
Contributor

Choose a reason for hiding this comment

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

@ronny1996 any comment?

@@ -476,27 +459,17 @@ def _check_finite_and_unscale(self, params_grads):
if self._is_distributed:
# if distributed, split check_finite_and_unscale to overlap
# unscale with communication
if core.is_compiled_with_custom_device('npu'):
Copy link
Contributor

Choose a reason for hiding this comment

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

@ronny1996 any comment?

@@ -220,24 +220,7 @@ def backward(
"""
train_program = loss.block.program
self._train_program = train_program

# NOTE(zhiqiu): _float_status is only used for NPU.
if core.is_compiled_with_custom_device('npu'):
Copy link
Contributor

Choose a reason for hiding this comment

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

@zhiqiu @ronny1996 any comment?

Copy link
Contributor

@KimBioInfoStudio KimBioInfoStudio left a comment

Choose a reason for hiding this comment

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

is_compiled_with_custom_device('npu')if...else... 请两位 看下是否合适现阶段就去掉 @ronny1996 @zhiqiu

@@ -1507,15 +1507,6 @@
func : nonzero
data_type: condition

- op : npu_identity
args : (Tensor x, int format = -1)
output : Tensor
Copy link
Contributor

Choose a reason for hiding this comment

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

这里暂时不删除

// See the License for the specific language governing permissions and
// limitations under the License.

#include "paddle/phi/kernels/npu_identity_kernel.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

@@ -725,29 +724,6 @@ def __init__(
)
self._variance.stop_gradient = True

# TODO(qili93): temporary for ascned npu performance to be removed along with npu_identity op
Copy link
Contributor

Choose a reason for hiding this comment

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

这里暂时不删除

@@ -145,16 +139,6 @@ def _conv_nd(
new_shape = [1] * len(x.shape)
new_shape[channel_dim] = -1
bias = bias.reshape(new_shape)
# TODO(qili93): temporary for ascned npu performance to be removed along with npu_identity op
if (
_global_flags()['FLAGS_npu_storage_format']
Copy link
Contributor

Choose a reason for hiding this comment

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

这里暂时不删除

@@ -739,29 +716,12 @@ def conv2d(
+ bias.shape
+ [1 for i in range(len(x.shape) - channel_dim - 1)],
)
# TODO(qili93): temporary for ascned npu performance to be removed along with npu_identity op
if (
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

@luotao1
Copy link
Contributor

luotao1 commented May 11, 2023

需要解决一下冲突

@Liyulingyue
Copy link
Contributor Author

Liyulingyue commented May 12, 2023

@luotao1 本pr合入后,还有以下NPU可能需要清理:

@Liyulingyue
Copy link
Contributor Author

Liyulingyue commented May 12, 2023

is_compiled_with_custom_device('npu')if...else... 请两位 看下是否合适现阶段就去掉 @ronny1996 @zhiqiu

@KimBioInfoStudio 根据#53568 中的评论 ,可能暂时不会被清除了。

@qili93
Copy link
Contributor

qili93 commented May 16, 2023

@luotao1 本pr合入后,还有以下NPU可能需要清理:

DeviceEventRecordCustomDevice 和 NPUStorageProperties 都请不要删除,是新增功能和退场的NPU代码无关;
tools路径 和 cmake路径下确认下是不是 npu 的 dockerfile 以及 npu.cmake 等文件,这些都是可以删除的

Copy link
Contributor

@ronny1996 ronny1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 5b054d2 into PaddlePaddle:develop May 16, 2023
@Liyulingyue Liyulingyue deleted the npu3 branch May 16, 2023 14:54
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants