-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
【PIR Dist Op Reg No.3】 reg c_allreduce_min #60584
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ const std::unordered_set<std::string> LegacyOpList = { | |
CReduceSumOp::name(), | ||
CReduceSum_Op::name(), | ||
CAllreduceMax_Op::name(), | ||
CAllreduceMin_Op::name(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同上 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里为什么没有 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @enkilee 这里可以提个补充PR,这个PR我先合入吧 |
||
CAllgatherOp::name(), | ||
CSoftmaxWithCrossEntropyOp::name(), | ||
CSoftmaxWithCrossEntropyGradOp::name(), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# 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, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import unittest | ||
|
||
import test_op_translator | ||
|
||
import paddle | ||
from paddle.base.layer_helper import LayerHelper | ||
|
||
|
||
class TestCAllReduceMinOpTranslator(test_op_translator.TestOpTranslator): | ||
def append_op(self): | ||
self.op_type = "c_allreduce_min" | ||
x = paddle.ones(shape=(100, 2, 3), dtype='float32') | ||
y = paddle.ones(shape=(100, 2, 3), dtype='float32') | ||
attrs = { | ||
'ring_id': 0, | ||
'use_calc_stream': False, | ||
'use_model_parallel': False, | ||
} | ||
helper = LayerHelper(self.op_type) | ||
helper.append_op( | ||
type=self.op_type, | ||
inputs={"X": x}, | ||
outputs={"Out": y}, | ||
attrs=attrs, | ||
) | ||
|
||
def test_translator(self): | ||
self.check() | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些算子名单可以考虑优化下,多处黑白名单不利于长期维护
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两处的用途不一样,名单也不完全重合,第二类主要是针对struct kernel,我觉得可能可以优化,之后研究下。