Skip to content

Commit

Permalink
update legion version (#1307)
Browse files Browse the repository at this point in the history
* update legion version

* legion version update

* update legion version
  • Loading branch information
jiazhihao authored Aug 12, 2024
1 parent 6a1a188 commit 9784b5c
Show file tree
Hide file tree
Showing 41 changed files with 59 additions and 50 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ if(NOT BUILD_LEGION_ONLY)
# generate the Legion Python bindings library. When building from pip, we need to do this post-install to prevent Legion from overwriting the path to the Legion shared library
add_custom_command(TARGET flexflow
POST_BUILD
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/deps/legion/bindings/python/setup.py build --cmake-build-dir ${Legion_BINARY_DIR}/runtime --prefix ${Legion_BINARY_DIR} --build-lib=${Legion_BINARY_DIR}/bindings/python ${Legion_PYTHON_EXTRA_INSTALL_ARGS}
COMMAND CMAKE_BUILD_DIR=${Legion_BINARY_DIR}/runtime CMAKE_INSTALL_PREFIX=${Legion_BINARY_DIR} ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/deps/legion/bindings/python/setup.py build --build-lib=${Legion_BINARY_DIR}/bindings/python ${Legion_PYTHON_EXTRA_INSTALL_ARGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/deps/legion/bindings/python
)
# create flexflow_python interpreter. When building from pip, we install the FF_HOME/python/flexflow_python script instead.
Expand Down
2 changes: 1 addition & 1 deletion deps/legion
Submodule legion updated from 24e8c4 to 02eb10
2 changes: 1 addition & 1 deletion examples/cpp/AlexNet/alexnet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using FlexFlow::ParallelTensor;
using FlexFlow::SGDOptimizer;
using FlexFlow::Tensor;

LegionRuntime::Logger::Category log_app("AlexNet");
Legion::Logger log_app("AlexNet");

void parse_input_args(char **argv, int argc, AlexNetConfig &config) {
for (int i = 1; i < argc; i++) {
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/DLRM/dlrm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

using namespace Legion;

LegionRuntime::Logger::Category log_app("DLRM");
Legion::Logger log_app("DLRM");

void parse_input_args(char **argv, int argc, DLRMConfig &apConfig);

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/InceptionV3/inception.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using namespace Legion;
using namespace FlexFlow;

LegionRuntime::Logger::Category log_app("Inceptionv3");
Legion::Logger log_app("Inceptionv3");

Tensor InceptionA(FFModel &ff, Tensor input, int pool_features) {
Tensor t1 = input;
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/ResNet/resnet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using FlexFlow::Optimizer;
using FlexFlow::SGDOptimizer;
using FlexFlow::Tensor;

LegionRuntime::Logger::Category log_app("ResNet");
Legion::Logger log_app("ResNet");

void parse_input_args(char **argv, int argc, ResNetConfig &config) {
for (int i = 1; i < argc; i++) {
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/Transformer/transformer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

using namespace Legion;

LegionRuntime::Logger::Category log_app("Transformer");
Legion::Logger log_app("Transformer");

Tensor create_emb(FFModel *model,
Tensor const &input,
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/XDL/xdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

using namespace Legion;

LegionRuntime::Logger::Category log_app("XDL");
Legion::Logger log_app("XDL");

void parse_input_args(char **argv, int argc, XDLConfig &apConfig);

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/candle_uno/candle_uno.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using namespace Legion;
using namespace std;

LegionRuntime::Logger::Category log_app("Candle_Uno");
Legion::Logger log_app("Candle_Uno");

void parse_input_args(char **argv, int argc, CandleConfig &apConfig);

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/mixture_of_experts/moe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

using namespace Legion;

LegionRuntime::Logger::Category log_app("MoE");
Legion::Logger log_app("MoE");

void parse_input_args(char **argv, int argc, MoeConfig &config) {
for (int i = 1; i < argc; i++) {
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/resnext50/resnext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using FlexFlow::Optimizer;
using FlexFlow::SGDOptimizer;
using FlexFlow::Tensor;

LegionRuntime::Logger::Category log_app("resnext");
Legion::Logger log_app("resnext");

Tensor resnext_block(FFModel &ff,
Tensor input,
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/split_test/split_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using namespace Legion;
using namespace FlexFlow;

LegionRuntime::Logger::Category log_app("split_test");
Legion::Logger log_app("split_test");

void FlexFlow::top_level_task(Task const *task,
std::vector<PhysicalRegion> const &regions,
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/split_test_2/split_test_2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using FlexFlow::PCG::Graph;
using FlexFlow::PCG::GraphSearchHelper;
using FlexFlow::PCG::Node;

LegionRuntime::Logger::Category log_app("split_test_2");
Legion::Logger log_app("split_test_2");

void top_level_task(Task const *task,
std::vector<PhysicalRegion> const &regions,
Expand Down
2 changes: 1 addition & 1 deletion include/flexflow/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "legion/legion_utilities.h"
#include <unordered_set>

extern LegionRuntime::Logger::Category log_dp;
extern Legion::Logger log_dp;

namespace FlexFlow::PCG {

Expand Down
4 changes: 3 additions & 1 deletion include/flexflow/operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace FlexFlow {

extern LegionRuntime::Logger::Category log_measure;
extern Legion::Logger log_measure;

class OpMeta;
class Simulator;
Expand Down Expand Up @@ -233,6 +233,8 @@ class Op {
std::vector<ParallelTensor> const &,
MachineView const *mv = nullptr) {
assert(false);
Legion::FutureMap empty_map;
return empty_map;
};
virtual void print_layer(FFModel const &model) = 0;
template <typename OpMetaType>
Expand Down
4 changes: 2 additions & 2 deletions include/flexflow/utils/recursive_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DepthTag {

class RecursiveLogger {
public:
/* RecursiveLogger(LegionRuntime::Logger::Category const &); */
/* RecursiveLogger(Legion::Logger const &); */
RecursiveLogger(std::string const &category_name);

Realm::LoggerMessage info();
Expand All @@ -42,7 +42,7 @@ class RecursiveLogger {

void print_prefix(Realm::LoggerMessage &) const;

LegionRuntime::Logger::Category logger;
Legion::Logger logger;
};

}; // namespace FlexFlow
Expand Down
2 changes: 1 addition & 1 deletion inference/incr_decoding/incr_decoding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using namespace FlexFlow;
using namespace Legion;
using json = nlohmann::json;

LegionRuntime::Logger::Category log_app("llama");
Legion::Logger log_app("llama");

struct FilePaths {
std::string cache_folder_path;
Expand Down
2 changes: 1 addition & 1 deletion inference/spec_infer/spec_infer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace FlexFlow;
using namespace Legion;
using json = nlohmann::json;

LegionRuntime::Logger::Category log_app("llama");
Legion::Logger log_app("llama");

struct FilePaths {
std::string cache_folder_path;
Expand Down
7 changes: 6 additions & 1 deletion src/mapper/mapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace FlexFlow {
using namespace Legion;
using namespace Mapping;

LegionRuntime::Logger::Category log_ff_mapper("Mapper");
Legion::Logger log_ff_mapper("Mapper");

FFShardingFunctor::FFShardingFunctor(int _gpus_per_node,
int _cpus_per_node,
Expand Down Expand Up @@ -296,6 +296,7 @@ void FFMapper::select_task_options(const MapperContext ctx,
// control replicate top level task
if (enable_control_replication) {
output.replicate = true;
output.map_locally = false;
}
return;
}
Expand Down Expand Up @@ -560,6 +561,10 @@ void FFMapper::map_task(const MapperContext ctx,
assert(output.target_procs[i].address_space() == node_id);
}
}
if (input.shard_processor.exists()) {
output.target_procs = std::vector<Processor>{input.shard_processor};
}

// Find instances that still need to be mapped
std::vector<std::set<FieldID>> missing_fields(task.regions.size());
runtime->filter_instances(ctx,
Expand Down
2 changes: 1 addition & 1 deletion src/ops/beam_topk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ using Legion::coord_t;
enum class HeapType { kMinHeap, kMaxHeap };
enum class PreferIndices { kLower, kHigher };

LegionRuntime::Logger::Category log_beam_topk("BeamTopK");
Legion::Logger log_beam_topk("BeamTopK");

template <typename T>
struct Entry {
Expand Down
2 changes: 1 addition & 1 deletion src/ops/beam_topk.cu
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ using Legion::coord_t;
enum class HeapType { kMinHeap, kMaxHeap };
enum class PreferIndices { kLower, kHigher };

LegionRuntime::Logger::Category log_beam_topk("BeamTopK");
Legion::Logger log_beam_topk("BeamTopK");

template <typename T>
struct Entry {
Expand Down
2 changes: 1 addition & 1 deletion src/ops/inc_multihead_self_attention.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using Legion::TaskArgument;
using Legion::TaskLauncher;
using PCG::Node;

LegionRuntime::Logger::Category log_inc_mha("IncrementalMHA");
Legion::Logger log_inc_mha("IncrementalMHA");

bool IncMultiHeadSelfAttentionParams::is_valid(
ParallelTensorShape const &input) const {
Expand Down
2 changes: 1 addition & 1 deletion src/ops/tree_inc_multihead_self_attention.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using Legion::TaskArgument;
using Legion::TaskLauncher;
using PCG::Node;

LegionRuntime::Logger::Category log_tree_verify("TreeVerifyIncMHA");
Legion::Logger log_tree_verify("TreeVerifyIncMHA");

bool TreeIncMultiHeadSelfAttentionParams::is_valid(
ParallelTensorShape const &input) const {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/batch_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace FlexFlow {

LegionRuntime::Logger::Category log_bc("BatchConfig");
Legion::Logger log_bc("BatchConfig");
using Legion::Future;
using Legion::Memory;

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/beam_search_batch_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace FlexFlow {

LegionRuntime::Logger::Category log_beam_bc("BeamSearchBatchConfig");
Legion::Logger log_beam_bc("BeamSearchBatchConfig");

BeamSearchBatchConfig::BeamSearchBatchConfig() : BatchConfig() {
this->beam_width = DEFAULT_BEAM_WIDTH;
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ namespace FlexFlow::PCG {
using namespace Legion;
using FlexFlow::MachineView;

LegionRuntime::Logger::Category log_graph("graph");
LegionRuntime::Logger::Category log_simplify("graph_simplify");
Legion::Logger log_graph("graph");
Legion::Logger log_simplify("graph_simplify");

const Node Node::INVALID_NODE = Node();

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/inference_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace FlexFlow {

using namespace Legion;

LegionRuntime::Logger::Category log_inf_mgr("InferenceManager");
LegionRuntime::Logger::Category log_offload("Offloading");
Legion::Logger log_inf_mgr("InferenceManager");
Legion::Logger log_offload("Offloading");

InferenceManager::InferenceManager() {}

Expand Down
6 changes: 4 additions & 2 deletions src/runtime/model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ namespace FlexFlow {

using namespace Legion;

LegionRuntime::Logger::Category log_model("Model");
LegionRuntime::Logger::Category log_measure("measure");
Legion::Logger log_model("Model");
Legion::Logger log_measure("measure");

Op::Op(FFModel &model,
OperatorType otype,
Expand Down Expand Up @@ -6748,6 +6748,7 @@ void register_flexflow_internal_tasks(Runtime *runtime,
TaskVariantRegistrar registrar(SGD_UPD_NCCL_TASK_ID, "SGD NCCL Update");
registrar.add_constraint(ProcessorConstraint(Processor::TOC_PROC));
registrar.set_leaf();
registrar.set_concurrent();
if (pre_register) {
Runtime::preregister_task_variant<SGDOptimizer::nccl_update_task>(
registrar, "SGD NCCL Update Task");
Expand Down Expand Up @@ -6898,6 +6899,7 @@ void register_flexflow_internal_tasks(Runtime *runtime,
"NCCL Init Communicators");
registrar.add_constraint(ProcessorConstraint(Processor::TOC_PROC));
registrar.set_leaf();
registrar.set_concurrent();
if (pre_register) {
Runtime::preregister_task_variant<ncclComm_t, Op::init_nccl_comms_task>(
registrar, "NCCL Init Communicators Task");
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/optimizer_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace FlexFlow {

LegionRuntime::Logger::Category log_optimizer("optimizer");
Legion::Logger log_optimizer("optimizer");

__global__ void sgd_update(size_t count,
float lr,
Expand Down Expand Up @@ -247,4 +247,4 @@ __host__ void AdamOptimizer::nccl_update_task_gpu(AdamOptimizer const *op,
}
#endif

}; // namespace FlexFlow
}; // namespace FlexFlow
2 changes: 1 addition & 1 deletion src/runtime/optimizer_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace FlexFlow {

LegionRuntime::Logger::Category log_optimizer("optimizer");
Legion::Logger log_optimizer("optimizer");

__global__ void sgd_update(size_t count,
float lr,
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/request_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace FlexFlow {
using namespace Legion;
using tokenizers::Tokenizer;

LegionRuntime::Logger::Category log_req_mgr("RequestManager");
Legion::Logger log_req_mgr("RequestManager");

std::string LoadBytesFromFile(std::string const &path) {
std::ifstream fs(path, std::ios::in | std::ios::binary);
Expand Down
8 changes: 4 additions & 4 deletions src/runtime/simulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ namespace FlexFlow {

using namespace Legion;

LegionRuntime::Logger::Category log_sim("sim");
LegionRuntime::Logger::Category log_ps_sim("ps_sim");
LegionRuntime::Logger::Category log_xfer_sim("xfer_sim");
LegionRuntime::Logger::Category log_xfer_est("xfer_est");
Legion::Logger log_sim("sim");
Legion::Logger log_ps_sim("ps_sim");
Legion::Logger log_xfer_sim("xfer_sim");
Legion::Logger log_xfer_est("xfer_est");

// template class std::map<const Op*, ParallelConfig>; // for debugging in gdb
// template class std::map<const Op*, MachineView>; // for debugging in gdb
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/substitution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ namespace FlexFlow::PCG {

using namespace Legion;

LegionRuntime::Logger::Category log_xfers("xfers");
LegionRuntime::Logger::Category log_xfer_matches("xfer_matches");
Legion::Logger log_xfers("xfers");
Legion::Logger log_xfer_matches("xfer_matches");

const TensorX TensorX::NO_TX = TensorX();

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/tree_verify_batch_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace FlexFlow {

LegionRuntime::Logger::Category log_tree_bc("TreeVerifyBatchConfig");
Legion::Logger log_tree_bc("TreeVerifyBatchConfig");

TreeVerifyBatchConfig::TreeVerifyBatchConfig() : BatchConfig() {}

Expand Down
2 changes: 1 addition & 1 deletion tests/ops/batch_matmul_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <iostream>
#include <sstream>
using namespace Legion;
LegionRuntime::Logger::Category log_app("bmm_test");
Legion::Logger log_app("bmm_test");

struct BMMTestMeta {
int m, k, n, d;
Expand Down
2 changes: 1 addition & 1 deletion tests/ops/concat_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <iostream>
#include <sstream>
using namespace Legion;
LegionRuntime::Logger::Category log_app("concat_test");
Legion::Logger log_app("concat_test");

struct ConcatTestMeta {
int batch_size, i_dim, num_channels, projected_num_channels,
Expand Down
Loading

0 comments on commit 9784b5c

Please sign in to comment.