Skip to content

Commit cef90af

Browse files
committed
Fix
1 parent 2ab18a0 commit cef90af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+141
-145
lines changed

paddle/cinn/common/ir_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ inline void UnpackReduction(const ir::IndexExpr &expr, FLeaf fleaf) {
191191
}
192192

193193
/*!
194-
* \brief Flatten the expression into a vector of expressions splited by `Add`
194+
* \brief Flatten the expression into a vector of expressions split by `Add`
195195
* or `Mul`.
196196
*
197197
* For example (Add):

paddle/cinn/hlir/pe/ir_schedule_pe.cc

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ void IRElementwiseSchedule(ir::IRSchedule &ir_sch, // NOLINT
8383
if (size <= target.max_num_threads()) {
8484
ir_sch.Bind(loop, "threadIdx.x");
8585
} else {
86-
auto splited = ir_sch.Split(loop, {-1, target.max_num_threads()});
87-
ir_sch.Bind(splited[0], "blockIdx.x");
88-
ir_sch.Bind(splited[1], "threadIdx.x");
86+
auto split = ir_sch.Split(loop, {-1, target.max_num_threads()});
87+
ir_sch.Bind(split[0], "blockIdx.x");
88+
ir_sch.Bind(split[1], "threadIdx.x");
8989
}
9090
};
9191
target.arch.Match(
@@ -117,9 +117,9 @@ void IRInjectiveSchedule(ir::IRSchedule &ir_sch, // NOLINT
117117
if (size <= target.max_num_threads()) {
118118
ir_sch.Bind(loop, "threadIdx.x");
119119
} else {
120-
auto splited = ir_sch.Split(loop, {-1, target.max_num_threads()});
121-
ir_sch.Bind(splited[0], "blockIdx.x");
122-
ir_sch.Bind(splited[1], "threadIdx.x");
120+
auto split = ir_sch.Split(loop, {-1, target.max_num_threads()});
121+
ir_sch.Bind(split[0], "blockIdx.x");
122+
ir_sch.Bind(split[1], "threadIdx.x");
123123
}
124124
};
125125
target.arch.Match(
@@ -172,10 +172,10 @@ void IRScheduleInjectiveCPU(ir::IRSchedule &ir_sch, // NOLINT
172172
auto loops = ir_sch.GetLoops(all_blocks[0]);
173173
int last_shape = ir::GetLoopExtent(loops.back());
174174
factor = GetVectorizeFactor(last_shape, factor);
175-
auto splited = ir_sch.Split(loops.back(), {-1, factor});
176-
ir_sch.Vectorize(splited[1], factor);
175+
auto split = ir_sch.Split(loops.back(), {-1, factor});
176+
ir_sch.Vectorize(split[1], factor);
177177
if (dims == 1) {
178-
ir_sch.Parallel(splited[0]);
178+
ir_sch.Parallel(split[0]);
179179
}
180180
} */
181181
VLOG(3) << "After IRScheduleInjectiveCPU, new ir is : "
@@ -195,9 +195,9 @@ void IRGpuScheduleInjective(ir::IRSchedule &ir_sch, // NOLINT
195195
int prod_size = std::accumulate(
196196
output_shape.begin(), output_shape.end(), 1, std::multiplies<int>());
197197
if (prod_size > num_thread) {
198-
auto splited = ir_sch.Split(fused, {-1, num_thread});
199-
ir_sch.Bind(splited[0], "blockIdx.x");
200-
ir_sch.Bind(splited[1], "threadIdx.x");
198+
auto split = ir_sch.Split(fused, {-1, num_thread});
199+
ir_sch.Bind(split[0], "blockIdx.x");
200+
ir_sch.Bind(split[1], "threadIdx.x");
201201
} else {
202202
ir_sch.Bind(fused, "threadIdx.x");
203203
}
@@ -242,9 +242,9 @@ std::vector<cinn::common::CINNValue> IRGpuScheduleMatMul(
242242
auto loops = ir_sch.GetLoops(init_block);
243243
if (loops.size() == 1) {
244244
if (ir::GetLoopExtent(loops[0]) > num_thread) {
245-
auto splited = ir_sch.Split(loops[0], {-1, num_thread});
246-
ir_sch.Bind(splited[0], "blockIdx.x");
247-
ir_sch.Bind(splited[1], "threadIdx.x");
245+
auto split = ir_sch.Split(loops[0], {-1, num_thread});
246+
ir_sch.Bind(split[0], "blockIdx.x");
247+
ir_sch.Bind(split[1], "threadIdx.x");
248248
} else {
249249
ir_sch.Bind(loops[0], "threadIdx.x");
250250
}
@@ -273,7 +273,7 @@ void IRCudaScheduleMul(ir::IRSchedule &ir_sch, // NOLINT
273273
2U,
274274
::common::errors::InvalidArgument(
275275
"The size of loops should be greater than 2."));
276-
auto splited = ir_sch.Split(loops[1], {-1, 2});
276+
auto split = ir_sch.Split(loops[1], {-1, 2});
277277
all_blocks = ir_sch.GetAllBlocks();
278278
loops = ir_sch.GetLoops(all_blocks.back());
279279
ir_sch.Bind(loops[0], "blockIdx.x");
@@ -349,15 +349,14 @@ void IRCudaSplitSchedule(ir::IRSchedule &ir_sch, // NOLINT
349349

350350
if (tsize > target.max_num_threads()) {
351351
// split [-1, 256]
352-
auto splited = ir_sch.Split(ir_sch.GetLoops(block_name)[0],
353-
{-1, target.max_num_threads() / 4});
354-
ir_sch.Bind(splited[0], "blockIdx.x");
355-
ir_sch.Bind(splited[1], "threadIdx.x");
352+
auto split = ir_sch.Split(ir_sch.GetLoops(block_name)[0],
353+
{-1, target.max_num_threads() / 4});
354+
ir_sch.Bind(split[0], "blockIdx.x");
355+
ir_sch.Bind(split[1], "threadIdx.x");
356356
} else {
357-
auto splited =
358-
ir_sch.Split(ir_sch.GetLoops(block_name)[0], {1, tsize});
359-
ir_sch.Bind(splited[0], "blockIdx.x");
360-
ir_sch.Bind(splited[1], "threadIdx.x");
357+
auto split = ir_sch.Split(ir_sch.GetLoops(block_name)[0], {1, tsize});
358+
ir_sch.Bind(split[0], "blockIdx.x");
359+
ir_sch.Bind(split[1], "threadIdx.x");
361360
}
362361
}
363362
} else {
@@ -373,15 +372,15 @@ void IRCudaSplitSchedule(ir::IRSchedule &ir_sch, // NOLINT
373372
auto tsize = first_loop.As<ir::For>()->extent.as_int32();
374373
if (tsize > target.max_num_threads()) {
375374
// split [-1, 256]
376-
auto splited = ir_sch.Split(ir_sch.GetLoops(block_names[idx])[0],
377-
{-1, target.max_num_threads() / 4});
378-
ir_sch.Bind(splited[0], "blockIdx.x");
379-
ir_sch.Bind(splited[1], "threadIdx.x");
375+
auto split = ir_sch.Split(ir_sch.GetLoops(block_names[idx])[0],
376+
{-1, target.max_num_threads() / 4});
377+
ir_sch.Bind(split[0], "blockIdx.x");
378+
ir_sch.Bind(split[1], "threadIdx.x");
380379
} else {
381-
auto splited =
380+
auto split =
382381
ir_sch.Split(ir_sch.GetLoops(block_names[idx])[0], {1, tsize});
383-
ir_sch.Bind(splited[0], "blockIdx.x");
384-
ir_sch.Bind(splited[1], "threadIdx.x");
382+
ir_sch.Bind(split[0], "blockIdx.x");
383+
ir_sch.Bind(split[1], "threadIdx.x");
385384
}
386385
}
387386
}
@@ -1180,9 +1179,9 @@ void IRPoolScheduleGPU(ir::IRSchedule &ir_sch, // NOLINT
11801179
// Blocks were changed after Fuse, so we have to get all blocks again.
11811180
all_blocks = ir_sch.GetAllBlocks();
11821181
loops = ir_sch.GetLoops(all_blocks[0]);
1183-
auto splited = ir_sch.Split(loops[0], {-1, 1024});
1184-
ir_sch.Bind(splited[0], "blockIdx.x");
1185-
ir_sch.Bind(splited[1], "threadIdx.x");
1182+
auto split = ir_sch.Split(loops[0], {-1, 1024});
1183+
ir_sch.Bind(split[0], "blockIdx.x");
1184+
ir_sch.Bind(split[1], "threadIdx.x");
11861185
VLOG(3) << "End IRPoolScheduleGPU: " << ir_sch.GetModule().GetExprs().at(0);
11871186
}
11881187

@@ -1198,14 +1197,14 @@ void IRGlobalPoolScheduleGPU(ir::IRSchedule &ir_sch, // NOLINT
11981197
auto loops = ir_sch.GetLoops(all_blocks[1]);
11991198
if (loops.size() > 1) {
12001199
auto fused = ir_sch.Fuse(all_blocks[0], {0, 1});
1201-
auto splited = ir_sch.Split(fused, {-1, 32});
1200+
auto split = ir_sch.Split(fused, {-1, 32});
12021201
all_blocks = ir_sch.GetAllBlocks();
12031202
fused = ir_sch.Fuse(all_blocks[1], {0, 1});
1204-
splited = ir_sch.Split(fused, {-1, 32});
1205-
ir_sch.Bind(splited[0], "blockIdx.x");
1206-
ir_sch.Bind(splited[1], "threadIdx.y");
1203+
split = ir_sch.Split(fused, {-1, 32});
1204+
ir_sch.Bind(split[0], "blockIdx.x");
1205+
ir_sch.Bind(split[1], "threadIdx.y");
12071206
all_blocks = ir_sch.GetAllBlocks();
1208-
ir_sch.SimpleComputeAt(all_blocks[0], splited[1]);
1207+
ir_sch.SimpleComputeAt(all_blocks[0], split[1]);
12091208
all_blocks = ir_sch.GetAllBlocks();
12101209
ir_sch.SetBuffer(all_blocks[0], "local", true);
12111210
loops = ir_sch.GetLoops(all_blocks[0]);
@@ -1218,15 +1217,15 @@ void IRGlobalPoolScheduleGPU(ir::IRSchedule &ir_sch, // NOLINT
12181217
ir_sch.Bind(loops[2], "threadIdx.x");
12191218
} else {
12201219
loops = ir_sch.GetLoops(all_blocks[0]);
1221-
auto splited = ir_sch.Split(loops[0], {-1, 32});
1220+
auto split = ir_sch.Split(loops[0], {-1, 32});
12221221
all_blocks = ir_sch.GetAllBlocks();
12231222
loops = ir_sch.GetLoops(all_blocks[1]);
1224-
splited = ir_sch.Split(loops[0], {-1, 32});
1225-
ir_sch.Bind(splited[0], "blockIdx.x");
1226-
ir_sch.Bind(splited[1], "threadIdx.y");
1223+
split = ir_sch.Split(loops[0], {-1, 32});
1224+
ir_sch.Bind(split[0], "blockIdx.x");
1225+
ir_sch.Bind(split[1], "threadIdx.y");
12271226
all_blocks = ir_sch.GetAllBlocks();
1228-
splited = ir_sch.GetLoops(all_blocks[1]);
1229-
ir_sch.SimpleComputeAt(all_blocks[0], splited[1]);
1227+
split = ir_sch.GetLoops(all_blocks[1]);
1228+
ir_sch.SimpleComputeAt(all_blocks[0], split[1]);
12301229
all_blocks = ir_sch.GetAllBlocks();
12311230
ir_sch.SetBuffer(all_blocks[0], "local", true);
12321231
loops = ir_sch.GetLoops(all_blocks[0]);

paddle/cinn/ir/ir_printer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct IrPrinter : public IRVisitorRequireReImpl<void>,
4141
void Print(const stmt::StmtRef &stmt);
4242
//! Emit a block on the output stream.
4343
void Print(const stmt::BlockRef &block);
44-
//! Emit a expression list with , splitted.
44+
//! Emit a expression list with , split.
4545
void Print(const std::vector<Expr> &exprs,
4646
const std::string &splitter = ", ");
4747
//! Emit a binary operator

paddle/cinn/ir/schedule/impl/compute_location.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ void DyScheduleImpl::SimpleComputeAt(const Expr& block, const Expr& loop) {
123123
GetLoopExtent(loops[0]) != 1) &&
124124
block_loops[0].As<ir::For>()->extent.is_constant() &&
125125
GetLoopExtent(block_loops[0]) == 1) {
126-
auto splited = this->Split(loops[0], {1, -1});
127-
this_loop = splited[1];
126+
auto split = this->Split(loops[0], {1, -1});
127+
this_loop = split[1];
128128
}
129129

130130
block_loops = this->GetLoops(this_block);

paddle/cinn/ir/schedule/ir_schedule.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ class IRSchedule {
105105

106106
/**
107107
* \brief Split a for loop into multiple loops, based on the factors.
108-
* @param loop The loop to be splited.
108+
* @param loop The loop to be split.
109109
* @param factors The factors we used to split the loop.
110-
* @return The splited loops.
110+
* @return The split loops.
111111
*/
112112
std::vector<Expr> Split(const Expr& loop, const std::vector<int>& factors);
113113

114114
/**
115115
* \brief Split a for loop into multiple loops, based on the factors.
116116
* @param block_name Name of the block we want to modify.
117-
* @param loop_index Index of the loop to be splited.
117+
* @param loop_index Index of the loop to be split.
118118
* @param factors The factors we used to split the loop.
119-
* @return The splited loops.
119+
* @return The split loops.
120120
*/
121121
std::vector<Expr> Split(const std::string& block_name,
122122
int loop_index,
@@ -125,9 +125,9 @@ class IRSchedule {
125125
/**
126126
* \brief Split a for loop into multiple loops, based on the factors, only
127127
* used for deserialization of trace.
128-
* @param loop The loop to be splited.
128+
* @param loop The loop to be split.
129129
* @param factors The factors we used to split the loop.
130-
* @return The splited loops.
130+
* @return The split loops.
131131
*/
132132
std::vector<Expr> Split(const Expr& loop, const std::vector<Expr>& factors);
133133

paddle/cinn/ir/schedule/ir_schedule_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void ReplaceExpr(Expr* source,
134134
* Validate the factors param of Split. We will check if factors are validate
135135
* and change -1 to positive integer.
136136
* @param factors The original factors.
137-
* @param total_extent The extent of the loop to be splitted.
137+
* @param total_extent The extent of the loop to be split.
138138
* @return return The validated factors.
139139
*/
140140
std::vector<int> ValidateFactors(const std::vector<int>& factors,

paddle/cinn/lang/lower_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ std::vector<ir::Argument> LowerImpl::GenerateFunctionArgumentList(
149149

150150
return args;
151151
}
152-
// Generate Function Arguments for splitted kernel.
152+
// Generate Function Arguments for split kernel.
153153
std::vector<ir::Argument> LowerImpl::GenFuncArgForSplitKernel(
154154
Expr func_iterator, std::vector<ir::Tensor> temp_tensors) {
155155
CheckArgsUnique();

paddle/fluid/pybind/auto_parallel_py.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ void BindAutoParallel(py::module *m) {
451451
auto Shard = py::class_<phi::distributed::Shard,
452452
std::shared_ptr<phi::distributed::Shard>>(
453453
*m, "Shard", Placement, R"DOC(
454-
The `Shard` describes how `Tensor` splitted across multiple devices according to specified dimensions.
454+
The `Shard` describes how `Tensor` split across multiple devices according to specified dimensions.
455455
456456
Parameters:
457457
dim (int): specify the slicing dimension of the tensor.

paddle/phi/core/distributed/auto_parallel/process_mesh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ inline bool operator!=(const ProcessMesh& lhs, const ProcessMesh& rhs) {
9595
// split the mesh into sub-meshes at the given axis
9696
std::vector<ProcessMesh> SplitMesh(const ProcessMesh& mesh, int axis);
9797

98-
// return which dimension that the sub_mesh is splitted from the global_mesh,
98+
// return which dimension that the sub_mesh is split from the global_mesh,
9999
// if sub_mesh is not a subset of global_mesh, return -1
100100
int SubMeshDim(const ProcessMesh& global_mesh, const ProcessMesh& sub_mesh);
101101

102102
// when the shapes of two meshes are different and their process_ids
103103
// are the same, check whether the only difference is that mesh 'a'
104-
// has an additional '1' on the splitted dim of its shape.
104+
// has an additional '1' on the split dim of its shape.
105105
// e.g. a.shape = [2], b.shape = [2, 1], and the process_ids are the
106106
// same, then they are equal.
107107
bool mesh_equal_ignore_shape1(const ProcessMesh& a,

paddle/phi/core/distributed/auto_parallel/reshard/global_and_sub_mesh_reshard_function.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bool GlobalToSubMeshReshardFunction::IsSuitable(
3333

3434
int sub_mesh_dim = SubMeshDim(in_process_mesh, out_process_mesh);
3535
RESHARD_SHORTCUT_IF_FALSE(sub_mesh_dim != -1);
36-
// 1. the splitted dimension must be replicated
36+
// 1. the split dimension must be replicated
3737
// 2. out mesh is the value of a certain dimension of global mesh
3838
// e.g. global_mesh = [[1, 2], [3, 4]], out_mesh = [1, 2] or [3, 4]
3939
// global_mesh = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]

0 commit comments

Comments
 (0)