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

[CodeStyle][Typos][L-[1-7]] Fix typos(lable,lamda,labmda,lastest,Lanuch,lanuch,leyer,learing,Leafs,leafs) #70536

Merged
merged 2 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extend-exclude = [
"third_party",
"patches",
"build",
"test/dataset/imikolov_test.py"
"test/dataset/imikolov_test.py",
]

[default.extend-words]
Expand Down Expand Up @@ -210,16 +210,6 @@ interated = 'interated'
Iteraion = 'Iteraion'
IIT = 'IIT'
iy = 'iy'
lable = 'lable'
lamda = 'lamda'
labmda = 'labmda'
lastest = 'lastest'
Lanuch = 'Lanuch'
lanuch = 'lanuch'
leyer = 'leyer'
learing = 'learing'
Leafs = 'Leafs'
leafs = 'leafs'
occured = 'occured'
Ocurred = 'Ocurred'
occures = 'occures'
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/distributed/index_dataset/index_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ std::vector<uint64_t> TreeIndex::GetTravelCodes(uint64_t id, int start_level) {
return res;
}

std::vector<IndexNode> TreeIndex::GetAllLeafs() {
std::vector<IndexNode> TreeIndex::GetAllLeaves() {
std::vector<IndexNode> res;
res.reserve(id_codes_map_.size());
for (auto& ite : id_codes_map_) {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/distributed/index_dataset/index_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class TreeIndex : public Index {
int level);
std::vector<uint64_t> GetChildrenCodes(uint64_t ancestor, int level);
std::vector<uint64_t> GetTravelCodes(uint64_t id, int start_level);
std::vector<IndexNode> GetAllLeafs();
std::vector<IndexNode> GetAllLeaves();

std::unordered_map<uint64_t, IndexNode> data_;
std::unordered_map<uint64_t, uint64_t> id_codes_map_;
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/ir/graph_pattern_detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class PDPattern {
* detector.mutable_pattern().AddEdge(node0, node1);
* // Create an handler, to define the behavior of treating the filtered
* // subgraphs that comply with the patterns.
* GraphPatternDetector::handle_t handler = some labmda
* GraphPatternDetector::handle_t handler = some lambda
* // Execute the detector.
* detector(&graph, handler);
*/
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/pir/drr/README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ DRR PASS 包含以下三个部分:
<tr>
<td> <pre>void AddConstraint(
const std::function&lt;bool(const MatchContext&)&gt;& constraint_fn)</pre></td>
<td> 在 SourcePattern 中定义一个约束,可以利用此接口和 lamda 表达式实现对 SourcePattern 的自定义约束</td>
<td> 在 SourcePattern 中定义一个约束,可以利用此接口和 lambda 表达式实现对 SourcePattern 的自定义约束</td>
<td> constraint_fn: 自定义的约束函数</td>
</tr>
<tr>
Expand Down
3 changes: 2 additions & 1 deletion paddle/fluid/pybind/fleet_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ void BindTreeIndex(py::module* m) {
.def("total_node_nums",
[](TreeIndex& self) { return self.TotalNodeNums(); })
.def("emb_size", [](TreeIndex& self) { return self.EmbSize(); })
.def("get_all_leafs", [](TreeIndex& self) { return self.GetAllLeafs(); })
.def("get_all_leaves",
[](TreeIndex& self) { return self.GetAllLeaves(); })
.def("get_nodes",
[](TreeIndex& self, const std::vector<uint64_t>& codes) {
return self.GetNodes(codes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using LayerNormScaleBiasT =
typename std::conditional<ScaleBiasWithSameTypeX, T, U>::type;

/**
* @brief fused add_bias, dropout, add residual and leyer_norm into one
* @brief fused add_bias, dropout, add residual and layer_norm into one
* operators. Currently only support forward
*/

Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/kernels/gpu/lars_momentum_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ void LarsMomentumKernel(
reinterpret_cast<void*>(&epsilon_),
reinterpret_cast<void*>(&rescale_grad_),
reinterpret_cast<void*>(&multi_precision)};
// Lanuch all sm theads, and thead of each block synchronizedly cooperate.
// Launch all sm theads, and thead of each block synchronizedly cooperate.
cudaLaunchCooperativeKernel(
reinterpret_cast<void*>(MergedMomentumLarsKernel<T, MT>),
lars_thread_config.grid_for_lars,
Expand Down Expand Up @@ -630,7 +630,7 @@ void LarsMomentumKernel(
reinterpret_cast<void*>(&thresh), // Just a placeholder
reinterpret_cast<void*>(&numel),
reinterpret_cast<void*>(&multi_precision)};
// Lanuch all sm theads.
// Launch all sm theads.
cudaLaunchCooperativeKernel(
reinterpret_cast<void*>(MomentumLarsKernel<T, MT>),
lars_thread_config.grid_for_lars,
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/gpu/top_k_grad_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void TopkGradKernel(const Context& dev_ctx,
const int max_blocks = std::max(((max_threads - 1) / block_size + 1), 1);
int grid_size = std::min(max_blocks, pre);

// lanuch the cuda kernel to assign the grad
// launch the cuda kernel to assign the grad
phi::funcs::AssignGradWithAxis<T>
<<<grid_size, block_size, 64 * 4, dev_ctx.stream()>>>(
out_grad_data, indices_data, x_grad_data, pre, post, n, k);
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/distributed/fleet/dataset/index_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def total_node_nums(self) -> int:
def emb_size(self) -> int:
return self._emb_size

def get_all_leafs(self) -> list[Any]:
return self._tree.get_all_leafs()
def get_all_leaves(self) -> list[Any]:
return self._tree.get_all_leaves()

def get_nodes(self, codes: list[int]) -> list[Any]:
return self._tree.get_nodes(codes)
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/optimizer/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def get_lr(self) -> float:
"""
Get current learning rate of optimizer.
If 'LRScheduler' is not used, the return value is all the same.
If 'LRScheduler' is used, the return value is the current scheduled learing rete.
If 'LRScheduler' is used, the return value is the current scheduled learning rete.

Returns:
float, The current learning rate of optimizer.
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/text/datasets/conll05.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ def _load_anno(self) -> None:

if len(label) == 0: # end of sentence
for i in range(len(one_seg[0])):
a_kind_lable = [x[i] for x in one_seg]
labels.append(a_kind_lable)
a_kind_label = [x[i] for x in one_seg]
labels.append(a_kind_label)

if len(labels) >= 1:
verb_list = []
Expand Down
2 changes: 1 addition & 1 deletion test/legacy_test/test_dist_tree_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_tree_index(self):
[node.id() for node in tree.get_nodes(layer_node_codes[-1])]
)

all_leaf_ids = [node.id() for node in tree.get_all_leafs()]
all_leaf_ids = [node.id() for node in tree.get_all_leaves()]
self.assertEqual(sum(all_leaf_ids), sum(layer_node_ids[-1]))

# get_travel
Expand Down
8 changes: 4 additions & 4 deletions tools/final_ut_parallel_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def classify_cases_by_mem(rootPath):
json.dump(all_tests_by_card, f)

with open("/pre_test/ut_mem_map.json", 'r') as load_f:
new_lastest_mem = json.load(load_f)
new_latest_mem = json.load(load_f)
no_parallel_case = '^job$'
for cardType in all_tests_by_card:
case_mem_0 = '^job$'
Expand All @@ -112,15 +112,15 @@ def classify_cases_by_mem(rootPath):
no_parallel_case = no_parallel_case + '|^' + case + '$'
continue

if case not in new_lastest_mem:
if case not in new_latest_mem:
continue

# mem = 0
if new_lastest_mem[case]["mem_nvidia"] == 0:
if new_latest_mem[case]["mem_nvidia"] == 0:
case_mem_0 = case_mem_0 + '|^' + case + '$'
# mem != 0
else:
case_mem_1[case] = new_lastest_mem[case]["mem_nvidia"]
case_mem_1[case] = new_latest_mem[case]["mem_nvidia"]

with open(f'/pre_test/{cardType}_mem0', 'w') as f:
f.write(case_mem_0)
Expand Down
Loading