Skip to content

Commit

Permalink
Fix some spelling errors. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
opti-mix committed Apr 7, 2019
1 parent d2347f3 commit 0608054
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions include/glow/Partitioner/Partitioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,22 @@ class Partitioner {
/// update the memSize.
static Function *selectRepFunc(Module *parent, uint64_t &memSize);

/// Get the minimal memory requirement for each op in the representive
/// Get the minimal memory requirement for each op in the representative
/// function.
void initOpMemUsage();

/// Inititalize the minimal compute time for each op in the function.
void initOpComputeTime();

/// Combine the partitions if necessary : if all outside uses of the nodes in
/// /// partition1 is in partition2, and the sum of memory consumption of
/// partition1 is in partition2, and the sum of memory consumption of
/// partition1 and partition2 is less than availableMemory, combine partition1
/// and partition2.
void partitionsCombine(NodeToFunctionMap &partitions,
FunctionToNodesMapTy &nodesSet,
uint64_t availableMemory);

/// After getting the intial partitions, ajust the partitions to miminize
/// After getting the initial partitions, adjust the partitions to minimize
/// communication and computation cost.
void partitionsAdjust(NodeToFunctionMap &partitions,
uint64_t availableMemory);
Expand Down
14 changes: 7 additions & 7 deletions lib/Partitioner/Partitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Function *Partitioner::selectRepFunc(Module *parent, uint64_t &memSize) {
}
}
}
// Find the function with largest required memory as the representive
// Find the function with largest required memory as the representative
// function.
if (size > memSize) {
ret = F;
Expand Down Expand Up @@ -193,7 +193,7 @@ void Partitioner::initOpComputeTime() {

/// Compute compute roofline as max of flops, DRAM, SRAM BW
/// See https://bit.ly/2UdJ3mz
/// Add epsilons to prevent seg faults on unitialized peak values
/// Add epsilons to prevent seg faults on uninitialized peak values.
computeTime_[&node] =
std::max(totalOps * 1.0f / std::max(peakCompute, 1e-6f),
std::max(sizeDram * 1.0f / std::max(peakDramBw, 1e-6f),
Expand Down Expand Up @@ -262,7 +262,7 @@ void Partitioner::partitionsCombine(NodeToFunctionMap &partitions,

void Partitioner::partitionsAdjust(NodeToFunctionMap &partitions,
uint64_t availableMemory) {
// For each partitioin, create a node set.
// For each partition, create a node set.
FunctionToNodesMapTy nodesSet;
for (NodeToFunctionMapTy::iterator it = partitions.begin();
it != partitions.end(); ++it) {
Expand All @@ -286,7 +286,7 @@ void Partitioner::partitionsAdjust(NodeToFunctionMap &partitions,
bool gain = true;
while (gain) {
// gain is initialized as false, it will be set to be true if there is at
// least one node can be moved from one set to antoher set.
// least one node can be moved from one set to another set.
gain = false;
for (FunctionToNodesMapTy::iterator it = nodesSet.begin();
it != nodesSet.end(); ++it) {
Expand Down Expand Up @@ -321,7 +321,7 @@ void Partitioner::partitionsAdjust(NodeToFunctionMap &partitions,
// move won't change communication cost, according to rule 1 and rule 2,
// the memory consumption of the partition where this node (i.e
// outUsers[i]) belongs can be reduced. Therefore, it may trigger later
// node movement or paritionCombine.
// node movement or partitionsCombine.
nSet.insert(outUsers[i]);
GraphMemInfo cost = getGraphMemInfo(nSet);
Function *suc = partitions[outUsers[i]];
Expand Down Expand Up @@ -434,7 +434,7 @@ NodeToFunctionMap Partitioner::selectPartitions(Function *F,
/// there is only 2 devices.
void Partitioner::adjustLogicalDeviceID(DAGNode *DAG, int num) {}

/// Current only partition the representive function.
/// Current only partition the representative function.
void Partitioner::doPartitioning(Function *F, NodeToFunctionMap &mapping) {
// The dummy node.
rootDAGNodeTy DAGRoot = llvm::make_unique<DAGNode>();
Expand Down Expand Up @@ -548,7 +548,7 @@ void Partitioner::doPartitioning(Function *F, NodeToFunctionMap &mapping) {

DAGListTy &Partitioner::Partition() {

// Find the representive function for running partitioning algrithm.
// Find the representative function for running partitioning algorithm.
F_ = selectRepFunc(module_, memSize_);
uint64_t availMem = deviceInfo_[0].availableMemory;

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/PartitionerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void executeDAG(DAGNode *G, Module &mod, PlaceholderBindings &bindings,
}

/// This one tests the model with this feature: after BFS, the memory
/// comsumption of all the nodes in each level won't exceed the device memory
/// consumption of all the nodes in each level won't exceed the device memory
/// constraints.
TEST_F(PartitionerTest, Basic1) {
auto *input =
Expand Down

0 comments on commit 0608054

Please sign in to comment.