From 847c48a82dbbba8e1ddd43f16deb9c464d645de9 Mon Sep 17 00:00:00 2001 From: Mahmoud Ashraf Date: Tue, 16 May 2023 06:13:57 +0300 Subject: [PATCH] fix simple typos (#53783) * correct 1th to 1st * correct 1th to 1st * fix typo * fix typos --- .../framework/ir/seq_concat_fc_fuse_pass.cc | 4 ++-- python/paddle/distributed/utils/moe_utils.py | 18 +++++++++--------- .../tests/unittests/test_sparse_utils_op.py | 4 ++-- tools/CrossStackProfiler/DCGMFileReader.py | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/paddle/fluid/framework/ir/seq_concat_fc_fuse_pass.cc b/paddle/fluid/framework/ir/seq_concat_fc_fuse_pass.cc index 95dc32d20b0..070f6a51e30 100644 --- a/paddle/fluid/framework/ir/seq_concat_fc_fuse_pass.cc +++ b/paddle/fluid/framework/ir/seq_concat_fc_fuse_pass.cc @@ -32,8 +32,8 @@ PDNode* BuildSeqExpandConcatPattern(PDPattern* pattern) { // The following variables will be treat as inputs: // concat mid input, 0th input for fused op - // sequence_expand input, 1th input for fused op - // sequence_expand input, 2th input for fused op + // sequence_expand input, 1st input for fused op + // sequence_expand input, 2nd input for fused op // The following variables will be treat as outputs: // concat output diff --git a/python/paddle/distributed/utils/moe_utils.py b/python/paddle/distributed/utils/moe_utils.py index ae189389418..fa003c1a00d 100644 --- a/python/paddle/distributed/utils/moe_utils.py +++ b/python/paddle/distributed/utils/moe_utils.py @@ -35,19 +35,19 @@ def global_scatter( local_count[0] represents taking out 2 batches from x and sending 2 batches to the 0th expert of the 0th card; - local_count[1] represents taking out 0 batches from x and sending 0 batches to the 1th expert of the 0th card; + local_count[1] represents taking out 0 batches from x and sending 0 batches to the 1st expert of the 0th card; - local_count[2] represents taking out 2 batches from x and sending 2 batches to the 0th expert of the 1th card; + local_count[2] represents taking out 2 batches from x and sending 2 batches to the 0th expert of the 1st card; - local_count[3] represents taking out 0 batches from x and sending 0 batches to the 1th expert of the 1th card; + local_count[3] represents taking out 0 batches from x and sending 0 batches to the 1st expert of the 1st card; Therefore, the global_count[0] of the 0th card is equal to 2, which means that 2 batches of data are received from the 0th card to the 0th expert; - the global_count[1] of the 0th card is equal to 0, which means that 0 batches of data are received from the 0th card to the 1th expert; + the global_count[1] of the 0th card is equal to 0, which means that 0 batches of data are received from the 0th card to the 1st expert; - the global_count[0] of the 1th card is equal to 2, which means that 2 batches of data are received from the 0th card to the 0th expert; + the global_count[0] of the 1st card is equal to 2, which means that 2 batches of data are received from the 0th card to the 0th expert; - the global_count[1] of the 1th card is equal to 0, which means that 0 batches of data are received from the 0th card to the 1th expert. + the global_count[1] of the 1st card is equal to 0, which means that 0 batches of data are received from the 0th card to the 1st expert. .. image:: https://githubraw.cdn.bcebos.com/PaddlePaddle/docs/develop/docs/api/paddle/distributed/img/global_scatter_gather.png :width: 800 @@ -160,11 +160,11 @@ def global_gather( The global_count[0] of the 0th card represents sending 2 data to the 0th expert of the 0th card; - The global_count[1] of the 0th card represents sending 0 data to the 1th expert of the 0th card; + The global_count[1] of the 0th card represents sending 0 data to the 1st expert of the 0th card; - The global_count[0] of the 1th card represents sending 2 data to the 0th expert of the 0th card; + The global_count[0] of the 1st card represents sending 2 data to the 0th expert of the 0th card; - The global_count[1] of the 1th card represents sending 0 data to the 1th expert of the 0th card. + The global_count[1] of the 1st card represents sending 0 data to the 1st expert of the 0th card. .. image:: https://githubraw.cdn.bcebos.com/PaddlePaddle/docs/develop/docs/api/paddle/distributed/img/global_scatter_gather.png :width: 800 diff --git a/python/paddle/fluid/tests/unittests/test_sparse_utils_op.py b/python/paddle/fluid/tests/unittests/test_sparse_utils_op.py index 3504af44e00..f4d56d7e41b 100644 --- a/python/paddle/fluid/tests/unittests/test_sparse_utils_op.py +++ b/python/paddle/fluid/tests/unittests/test_sparse_utils_op.py @@ -342,12 +342,12 @@ class TestSparseConvert(unittest.TestCase): verify(dense_x) dense_x = paddle.randn(shape) - # set the 1th batch to zero + # set the 1st batch to zero dense_x[1] = 0 verify(dense_x) dense_x = paddle.randn(shape) - # set the 2th batch to zero + # set the 2nd batch to zero dense_x[2] = 0 verify(dense_x) diff --git a/tools/CrossStackProfiler/DCGMFileReader.py b/tools/CrossStackProfiler/DCGMFileReader.py index bb248e05868..f462ce5c9ad 100755 --- a/tools/CrossStackProfiler/DCGMFileReader.py +++ b/tools/CrossStackProfiler/DCGMFileReader.py @@ -136,7 +136,7 @@ class dcgmFileReader(FileReader): ) and not line.strip().startswith("# Entity"): continue - # skip non-needed headers (only the header in 1th line was needed) + # skip non-needed headers (only the header in 1st line was needed) if line.strip().startswith("# Entity"): line = line.strip()[2:] -- GitLab