Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
suranap committed Dec 14, 2024
1 parent 2a4c599 commit 693eb12
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion include/flexflow/dominators.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "tl/optional.hpp"
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <queue>

namespace FlexFlow::PCG::Utils {
template <typename G, typename Structure = GraphStructure<G>>
Expand Down
2 changes: 1 addition & 1 deletion include/flexflow/utils/hash_utils.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef _FLEXFLOW_HASH_UTILS_H
#define _FLEXFLOW_HASH_UTILS_H

#include <cstdint>
#include <climits>
#include <cstdint>
#include <functional>
#include <tuple>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/machine_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace FlexFlow {

using namespace Legion;

const MachineView MachineView::NO_VIEW = MachineView();
MachineView const MachineView::NO_VIEW = MachineView();

MachineView::MachineView()
: device_type(MachineView::GPU), ndims(0), start_device_id(0) {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/parallel_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void ParallelTensorBase::attach_raw_ptr(FFConfig &config,
Runtime *runtime = config.lg_hlr;
AttachLauncher launcher(EXTERNAL_INSTANCE, region, region);
std::vector<FieldID> fields(1, FID_DATA);
const Memory local_sysmem =
Memory const local_sysmem =
Machine::MemoryQuery(Machine::get_machine())
.has_affinity_to(runtime->get_executing_processor(ctx))
.only_kind(Memory::SYSTEM_MEM)
Expand Down
20 changes: 10 additions & 10 deletions src/runtime/simulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ CostMetrics Simulator::measure_operator_cost(Op const *op,
ParallelConfig Op::view_to_pc(MachineView const &view) const {
ParallelConfig config;
config.device_type = (ParallelConfig::DeviceType)view.device_type;
const ParallelTensor output = this->outputs[0];
ParallelTensor const output = this->outputs[0];
config.nDims = output->num_dims;
for (int i = 0; i < config.nDims; i++) {
if (output->dims[i].parallel_idx == -1) {
Expand Down Expand Up @@ -612,14 +612,14 @@ float Simulator::estimate_xfer_cost(Op const *op,
MachineView const &sink_view) {
// assert(tensor->is_valid_machine_view(source_view));
// assert(tensor->is_valid_machine_view(sink_view));
const ParallelTensor input_tensor = op->inputs[input_idx];
ParallelTensor const input_tensor = op->inputs[input_idx];
if (input_tensor->owner_op->op_type == OP_INPUT) {
return 0.0f;
}

if (op->is_parallel_op()) {
assert(input_idx == 0);
const ParallelTensor output_tensor = op->outputs[0];
ParallelTensor const output_tensor = op->outputs[0];
switch (op->op_type) {
case OP_REPARTITION: {
Repartition *rp = (Repartition *)op;
Expand All @@ -632,7 +632,7 @@ float Simulator::estimate_xfer_cost(Op const *op,
}
case OP_COMBINE: {
Combine *combine = (Combine *)op;
const ParallelTensor output_tensor = op->outputs[0];
ParallelTensor const output_tensor = op->outputs[0];
return this->estimate_repartition_xfer_cost(combine->combine_dim,
combine->combine_degree,
output_tensor->get_shape(),
Expand All @@ -654,7 +654,7 @@ float Simulator::estimate_xfer_cost(Op const *op,
}
case OP_REDUCTION: {
Reduction *reduction = (Reduction *)op;
const ParallelTensor output_tensor = op->outputs[0];
ParallelTensor const output_tensor = op->outputs[0];
ParallelTensorShape fake_output_shape = output_tensor->get_shape();
fake_output_shape.dims[reduction->reduction_dim].size *=
reduction->reduction_degree;
Expand All @@ -667,8 +667,8 @@ float Simulator::estimate_xfer_cost(Op const *op,
}
case OP_FUSED_PARALLEL: {
FusedParallelOp const *fused = (FusedParallelOp const *)op;
const ParallelTensor input_tensor = op->inputs[0];
const ParallelTensor output_tensor = op->outputs[0];
ParallelTensor const input_tensor = op->inputs[0];
ParallelTensor const output_tensor = op->outputs[0];
ParallelTensorShape input_shape = input_tensor->get_shape();
ParallelTensorShape output_shape = output_tensor->get_shape();
// FIXME: we currently calculate an over estimation
Expand Down Expand Up @@ -722,7 +722,7 @@ float Simulator::estimate_xfer_cost(Op const *op,
d.rect_data[i] = 0;
d.rect_data[i + d.dim] = source_view.dim[i] - 1;
}
const ParallelTensor input_tensor = op->inputs[input_idx];
ParallelTensor const input_tensor = op->inputs[input_idx];
size_t total_size = data_type_size(input_tensor->data_type);
for (int i = 0; i < input_tensor->num_dims; i++) {
total_size *= input_tensor->dims[i].size / input_tensor->dims[i].degree;
Expand Down Expand Up @@ -753,7 +753,7 @@ bool Op::estimate_sync_cost(Simulator *sim,
}

float Simulator::default_estimate_sync_cost(
const ParallelDim tensor_dims[MAX_TENSOR_DIM],
ParallelDim const tensor_dims[MAX_TENSOR_DIM],
int tensor_ndims,
MachineView const &view) {
ParallelTensorShape tensor_shape(tensor_ndims, tensor_dims, DT_FLOAT);
Expand All @@ -762,7 +762,7 @@ float Simulator::default_estimate_sync_cost(
tensor_shape, view, tensor_shape.get_num_replica_dims());
}

float Simulator::default_estimate_sync_cost(const ParallelTensor tensor,
float Simulator::default_estimate_sync_cost(ParallelTensor const tensor,
MachineView const &view,
int num_replica_dims) {
return this->default_estimate_sync_cost(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_machine_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ TEST(machine_view_hash, known_collision) {
mv1.start_device_id = 0;
mv1.dim[0] = 32;
mv1.stride[0] = 1;

MachineView mv2;
mv2.device_type = MachineView::GPU;
mv2.ndims = 1;
Expand Down

0 comments on commit 693eb12

Please sign in to comment.