From 3d2206e0ba6bff2c95b00f29c4ca3ed1578bccad Mon Sep 17 00:00:00 2001 From: SigureMo Date: Sat, 4 Jan 2025 14:48:22 +0800 Subject: [PATCH 1/4] [CodeStyle][Typos] Ignore 1-3 letter words to reduce false positives --- _typos.toml | 41 ++----------------- .../tensorrt_engine_instruction.cc | 2 +- .../operators/tensorrt/tensorrt_engine_op.h | 2 +- .../memory/allocation/allocator_facade.cc | 2 +- paddle/phi/kernels/funcs/blas/blas.h | 2 +- .../distributed/auto_parallel/interface.py | 2 +- .../paddle/io/dataloader/dataloader_iter.py | 2 +- 7 files changed, 10 insertions(+), 43 deletions(-) diff --git a/_typos.toml b/_typos.toml index 105488ce446b0b..0eef877c9ff647 100644 --- a/_typos.toml +++ b/_typos.toml @@ -4,35 +4,27 @@ extend-exclude = [ "third_party", "patches", "build", - "test/dataset/imikolov_test.py", ] +[default] +# Ignore 1-3 letter words, refer to https://github.com/crate-ci/typos/issues/1079 +extend-ignore-words-re = ["^[a-zA-Z]{1,3}$"] + [default.extend-words] # PaddlePaddle specific words -anc = 'anc' arange = "arange" astroid = 'astroid' -ba = 'ba' cacl = 'cacl' CANN = 'CANN' Clas = 'Clas' clen = 'clen' -cll = 'cll' dout = "dout" eles = 'eles' entrys = 'entrys' -FUL = 'FUL' grad = "grad" Halfs = 'Halfs' -hge = 'hge' kinf = 'kinf' -kow = 'kow' -lod = "lod" -Nce = "Nce" -Nd = "Nd" -ot = 'ot' pash = 'pash' -UE = "UE" unpacket = "unpacket" # These words need to be fixed @@ -97,7 +89,6 @@ filpped = 'filpped' flaot = 'flaot' follwed = 'follwed' folowing = 'folowing' -fot = 'fot' formater = 'formater' formating = 'formating' foramt = 'foramt' @@ -108,7 +99,6 @@ forwad = 'forwad' forword = 'forword' founf = 'founf' framwork = 'framwork' -fre = 'fre' frequence = 'frequence' fron = 'fron' fullfill = 'fullfill' @@ -171,17 +161,11 @@ invalide = 'invalide' iteratable = 'iteratable' interated = 'interated' Iteraion = 'Iteraion' -IIT = 'IIT' -iy = 'iy' occured = 'occured' Ocurred = 'Ocurred' occures = 'occures' -Fo = 'Fo' -fo = 'fo' offets = 'offets' offseted = 'offseted' -OLT = 'OLT' -pn = 'pn' Operants = 'Operants' operants = 'operants' oeprations = 'oeprations' @@ -343,10 +327,7 @@ sequnece = 'sequnece' sequentail = 'sequentail' serailize = 'serailize' settting = 'settting' -ser = 'ser' setted = 'setted' -SEH = 'SEH' -seh = 'seh' shoule = 'shoule' shoud = 'shoud' Singal = 'Singal' @@ -416,14 +397,9 @@ Temperary = 'Temperary' tenosr = 'tenosr' iterm = 'iterm' termiante = 'termiante' -ths = 'ths' -thi = 'thi' Theoritical = 'Theoritical' ther = 'ther' -thr = 'thr' thge = 'thge' -Teh = 'Teh' -tne = 'tne' thouse = 'thouse' theads = 'theads' thrads = 'thrads' @@ -436,7 +412,6 @@ TOOD = 'TOOD' tood = 'tood' TDOD = 'TDOD' toghether = 'toghether' -Rto = 'Rto' trainning = 'trainning' Traning = 'Traning' transforme = 'transforme' @@ -480,7 +455,6 @@ unziped = 'unziped' udpated = 'udpated' upgarde = 'upgarde' uptream = 'uptream' -ues = 'ues' unsed = 'unsed' uesd = 'uesd' usefull = 'usefull' @@ -501,27 +475,20 @@ varn = 'varn' warpped = 'warpped' warpper = 'warpper' Warpper = 'Warpper' -vas = 'vas' wheather = 'wheather' wether = 'wether' Wether = 'Wether' wieghts = 'wieghts' werid = 'werid' -whe = 'whe' Wheter = 'Wheter' whther = 'whther' whill = 'whill' whos = 'whos' -wil = 'wil' -wll = 'wll' wiil = 'wiil' witk = 'witk' -Wih = 'Wih' -wih = 'wih' worke = 'worke' workround = 'workround' worksapce = 'worksapce' -wrk = 'wrk' wrappered = 'wrappered' wraper = 'wraper' wraping = 'wraping' diff --git a/paddle/fluid/framework/new_executor/instruction/tensorrt_engine_instruction.cc b/paddle/fluid/framework/new_executor/instruction/tensorrt_engine_instruction.cc index 23d132aa432776..86353705dc2893 100644 --- a/paddle/fluid/framework/new_executor/instruction/tensorrt_engine_instruction.cc +++ b/paddle/fluid/framework/new_executor/instruction/tensorrt_engine_instruction.cc @@ -434,7 +434,7 @@ void TensorRTEngineInstruction::BindInputTensor( "have >0 elements, but now have %d elements. " "It's likely that this tensor is connected to a Concat op inside " "a trt-subgraph, " - "try to ues API to forbid this op into trt-subgraph.", + "try to use API to forbid this op into trt-subgraph.", input_name, input_tensor.numel())); diff --git a/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h b/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h index 0fdf84a630d3c0..70d6ee1fd7f2ad 100644 --- a/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h +++ b/paddle/fluid/operators/tensorrt/tensorrt_engine_op.h @@ -593,7 +593,7 @@ class TensorRTEngineOp : public framework::OperatorBase { "have >0 elements, but now have %d elements. " "It's likely that this tensor is connected to a Concat op inside " "a trt-subgraph, " - "try to ues API to forbid this op into trt-subgraph.", + "try to use API to forbid this op into trt-subgraph.", x, t.numel())); diff --git a/paddle/phi/core/memory/allocation/allocator_facade.cc b/paddle/phi/core/memory/allocation/allocator_facade.cc index 4ea82640b8ed2b..723ed314994031 100644 --- a/paddle/phi/core/memory/allocation/allocator_facade.cc +++ b/paddle/phi/core/memory/allocation/allocator_facade.cc @@ -825,7 +825,7 @@ class AllocatorFacadePrivate { void InitNaiveBestFitCPUAllocator() { #if defined(__APPLE__) && defined(__arm64__) // NOTE(wuweilong): It is more efficient to use CPUAllocator directly, - // but it wll cause some problem in Mac OS m1 chip, so we use + // but it will cause some problem in Mac OS m1 chip, so we use // NaiveBestFitAllocator instead. allocators_[phi::CPUPlace()] = std::make_shared(phi::CPUPlace()); diff --git a/paddle/phi/kernels/funcs/blas/blas.h b/paddle/phi/kernels/funcs/blas/blas.h index 2f27682247bdce..9cb5f352e0ce1b 100644 --- a/paddle/phi/kernels/funcs/blas/blas.h +++ b/paddle/phi/kernels/funcs/blas/blas.h @@ -42,7 +42,7 @@ namespace funcs { * `batch_size` times of GEMM. The batched GEMM could be faster base on the * implementation of the blas library. The batch size could be zero. If any * matrix of `matmul` has a batch size, there will be a batched GEMM, too. e.g., - * Mat A is [BatchSize, H1, W2], and Mat B [H2, W2], The result matrix wil be + * Mat A is [BatchSize, H1, W2], and Mat B [H2, W2], The result matrix will be * [BatchSize, H1, W2] * * The boolean flag, `trans`, describe the memory is the transpose of matrix or diff --git a/python/paddle/distributed/auto_parallel/interface.py b/python/paddle/distributed/auto_parallel/interface.py index 4c07e11b901467..eb360f063046d2 100644 --- a/python/paddle/distributed/auto_parallel/interface.py +++ b/python/paddle/distributed/auto_parallel/interface.py @@ -43,7 +43,7 @@ def shard_tensor(x, process_mesh=None, shard_spec=None): current process mesh cannot be found. Default: None. shard_spec (list, optional): a list to describe the sharding mapping between `x` and `process_mesh`, which means the dimension `i` of `x` is split across the dimension `shard_spec[i]` of `process_mesh`, - where `None` means that tensor dimension is not split. For example, given a tensor wih + where `None` means that tensor dimension is not split. For example, given a tensor with the shape [6, 12] and a process mesh with the shape [2, 3] and the dimension names ["x", "y"]: If `shard_spec=["x", "y"]`, each shard of the tensor will have a shape [3, 4]; If `shard_spec=["y", "x"]`, each shard of the tensor will have a shape [2, 6]; diff --git a/python/paddle/io/dataloader/dataloader_iter.py b/python/paddle/io/dataloader/dataloader_iter.py index 63dceeff30c5a6..63559eb6467a97 100644 --- a/python/paddle/io/dataloader/dataloader_iter.py +++ b/python/paddle/io/dataloader/dataloader_iter.py @@ -590,7 +590,7 @@ def _try_shutdown_all(self, timeout=None): self._clear_and_remove_data_queue() # set _workers_done_event should be set before put None - # to indices_queue, workers wll exit on reading None from + # to indices_queue, workers will exit on reading None from # indices_queue self._workers_done_event.set() for i in range(self._num_workers): From 3f08673fab7e02c788cd38b999a3539cda21ecc6 Mon Sep 17 00:00:00 2001 From: SigureMo Date: Sat, 4 Jan 2025 15:06:59 +0800 Subject: [PATCH 2/4] ignore `datas` --- _typos.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_typos.toml b/_typos.toml index bdeb1ef092ccc3..f93ed2b55998b9 100644 --- a/_typos.toml +++ b/_typos.toml @@ -18,6 +18,7 @@ cacl = 'cacl' CANN = 'CANN' Clas = 'Clas' clen = 'clen' +datas = 'datas' dout = "dout" eles = 'eles' entrys = 'entrys' @@ -32,9 +33,6 @@ Creater = 'Creater' creater = 'creater' dateset = 'dateset' dota = 'dota' -Datas = 'Datas' -DATAS = 'DATAS' -datas = 'datas' delt = 'delt' dealed = 'dealed' deciamls = 'deciamls' From 2696e1e295fa9c9e9016ede384c2bea924c120d1 Mon Sep 17 00:00:00 2001 From: SigureMo Date: Sat, 4 Jan 2025 15:08:05 +0800 Subject: [PATCH 3/4] ignore `dota` --- _typos.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_typos.toml b/_typos.toml index f93ed2b55998b9..bf863cd451b67f 100644 --- a/_typos.toml +++ b/_typos.toml @@ -19,6 +19,7 @@ CANN = 'CANN' Clas = 'Clas' clen = 'clen' datas = 'datas' +dota = 'dota' dout = "dout" eles = 'eles' entrys = 'entrys' @@ -32,7 +33,6 @@ unpacket = "unpacket" Creater = 'Creater' creater = 'creater' dateset = 'dateset' -dota = 'dota' delt = 'delt' dealed = 'dealed' deciamls = 'deciamls' From c42292826dd10e069dff1bc3c76a54a8f89f4617 Mon Sep 17 00:00:00 2001 From: SigureMo Date: Sat, 4 Jan 2025 15:10:14 +0800 Subject: [PATCH 4/4] ignore `feeded` --- _typos.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_typos.toml b/_typos.toml index bf863cd451b67f..1f913a25de8ad6 100644 --- a/_typos.toml +++ b/_typos.toml @@ -23,6 +23,7 @@ dota = 'dota' dout = "dout" eles = 'eles' entrys = 'entrys' +feeded = 'feeded' grad = "grad" Halfs = 'Halfs' kinf = 'kinf' @@ -51,7 +52,6 @@ downsteram = 'downsteram' faild = 'faild' Flase = 'Flase' featue = 'featue' -feeded = 'feeded' fetchs = 'fetchs' fileds = 'fileds' filterd = 'filterd'