diff --git a/gen/pb-cpp/flyteidl/plugins/mpi.grpc.pb.cc b/gen/pb-cpp/flyteidl/plugins/mpi.grpc.pb.cc new file mode 100644 index 0000000000..8a312292c0 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/mpi.grpc.pb.cc @@ -0,0 +1,24 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/mpi.proto + +#include "flyteidl/plugins/mpi.pb.h" +#include "flyteidl/plugins/mpi.grpc.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace flyteidl { +namespace plugins { + +} // namespace flyteidl +} // namespace plugins + diff --git a/gen/pb-cpp/flyteidl/plugins/mpi.grpc.pb.h b/gen/pb-cpp/flyteidl/plugins/mpi.grpc.pb.h new file mode 100644 index 0000000000..6725f0e0e8 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/mpi.grpc.pb.h @@ -0,0 +1,47 @@ +// Generated by the gRPC C++ plugin. +// If you make any local change, they will be lost. +// source: flyteidl/plugins/mpi.proto +#ifndef GRPC_flyteidl_2fplugins_2fmpi_2eproto__INCLUDED +#define GRPC_flyteidl_2fplugins_2fmpi_2eproto__INCLUDED + +#include "flyteidl/plugins/mpi.pb.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace grpc_impl { +class Channel; +class CompletionQueue; +class ServerCompletionQueue; +} // namespace grpc_impl + +namespace grpc { +namespace experimental { +template +class MessageAllocator; +} // namespace experimental +} // namespace grpc_impl + +namespace grpc { +class ServerContext; +} // namespace grpc + +namespace flyteidl { +namespace plugins { + +} // namespace plugins +} // namespace flyteidl + + +#endif // GRPC_flyteidl_2fplugins_2fmpi_2eproto__INCLUDED diff --git a/gen/pb-cpp/flyteidl/plugins/mpi.pb.cc b/gen/pb-cpp/flyteidl/plugins/mpi.pb.cc new file mode 100644 index 0000000000..87aa4c4581 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/mpi.pb.cc @@ -0,0 +1,461 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/mpi.proto + +#include "flyteidl/plugins/mpi.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +namespace flyteidl { +namespace plugins { +class DistributedMPITrainingTaskDefaultTypeInternal { + public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; +} _DistributedMPITrainingTask_default_instance_; +} // namespace plugins +} // namespace flyteidl +static void InitDefaultsDistributedMPITrainingTask_flyteidl_2fplugins_2fmpi_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::flyteidl::plugins::_DistributedMPITrainingTask_default_instance_; + new (ptr) ::flyteidl::plugins::DistributedMPITrainingTask(); + ::google::protobuf::internal::OnShutdownDestroyMessage(ptr); + } + ::flyteidl::plugins::DistributedMPITrainingTask::InitAsDefaultInstance(); +} + +::google::protobuf::internal::SCCInfo<0> scc_info_DistributedMPITrainingTask_flyteidl_2fplugins_2fmpi_2eproto = + {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsDistributedMPITrainingTask_flyteidl_2fplugins_2fmpi_2eproto}, {}}; + +void InitDefaults_flyteidl_2fplugins_2fmpi_2eproto() { + ::google::protobuf::internal::InitSCC(&scc_info_DistributedMPITrainingTask_flyteidl_2fplugins_2fmpi_2eproto.base); +} + +::google::protobuf::Metadata file_level_metadata_flyteidl_2fplugins_2fmpi_2eproto[1]; +constexpr ::google::protobuf::EnumDescriptor const** file_level_enum_descriptors_flyteidl_2fplugins_2fmpi_2eproto = nullptr; +constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_flyteidl_2fplugins_2fmpi_2eproto = nullptr; + +const ::google::protobuf::uint32 TableStruct_flyteidl_2fplugins_2fmpi_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::DistributedMPITrainingTask, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::DistributedMPITrainingTask, num_workers_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::DistributedMPITrainingTask, num_launcher_replicas_), + PROTOBUF_FIELD_OFFSET(::flyteidl::plugins::DistributedMPITrainingTask, slots_), +}; +static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::flyteidl::plugins::DistributedMPITrainingTask)}, +}; + +static ::google::protobuf::Message const * const file_default_instances[] = { + reinterpret_cast(&::flyteidl::plugins::_DistributedMPITrainingTask_default_instance_), +}; + +::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_flyteidl_2fplugins_2fmpi_2eproto = { + {}, AddDescriptors_flyteidl_2fplugins_2fmpi_2eproto, "flyteidl/plugins/mpi.proto", schemas, + file_default_instances, TableStruct_flyteidl_2fplugins_2fmpi_2eproto::offsets, + file_level_metadata_flyteidl_2fplugins_2fmpi_2eproto, 1, file_level_enum_descriptors_flyteidl_2fplugins_2fmpi_2eproto, file_level_service_descriptors_flyteidl_2fplugins_2fmpi_2eproto, +}; + +const char descriptor_table_protodef_flyteidl_2fplugins_2fmpi_2eproto[] = + "\n\032flyteidl/plugins/mpi.proto\022\020flyteidl.p" + "lugins\"_\n\032DistributedMPITrainingTask\022\023\n\013" + "num_workers\030\001 \001(\005\022\035\n\025num_launcher_replic" + "as\030\002 \001(\005\022\r\n\005slots\030\003 \001(\005B9Z7github.com/fl" + "yteorg/flyteidl/gen/pb-go/flyteidl/plugi" + "nsb\006proto3" + ; +::google::protobuf::internal::DescriptorTable descriptor_table_flyteidl_2fplugins_2fmpi_2eproto = { + false, InitDefaults_flyteidl_2fplugins_2fmpi_2eproto, + descriptor_table_protodef_flyteidl_2fplugins_2fmpi_2eproto, + "flyteidl/plugins/mpi.proto", &assign_descriptors_table_flyteidl_2fplugins_2fmpi_2eproto, 210, +}; + +void AddDescriptors_flyteidl_2fplugins_2fmpi_2eproto() { + static constexpr ::google::protobuf::internal::InitFunc deps[1] = + { + }; + ::google::protobuf::internal::AddDescriptors(&descriptor_table_flyteidl_2fplugins_2fmpi_2eproto, deps, 0); +} + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_flyteidl_2fplugins_2fmpi_2eproto = []() { AddDescriptors_flyteidl_2fplugins_2fmpi_2eproto(); return true; }(); +namespace flyteidl { +namespace plugins { + +// =================================================================== + +void DistributedMPITrainingTask::InitAsDefaultInstance() { +} +class DistributedMPITrainingTask::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DistributedMPITrainingTask::kNumWorkersFieldNumber; +const int DistributedMPITrainingTask::kNumLauncherReplicasFieldNumber; +const int DistributedMPITrainingTask::kSlotsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DistributedMPITrainingTask::DistributedMPITrainingTask() + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:flyteidl.plugins.DistributedMPITrainingTask) +} +DistributedMPITrainingTask::DistributedMPITrainingTask(const DistributedMPITrainingTask& from) + : ::google::protobuf::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&num_workers_, &from.num_workers_, + static_cast(reinterpret_cast(&slots_) - + reinterpret_cast(&num_workers_)) + sizeof(slots_)); + // @@protoc_insertion_point(copy_constructor:flyteidl.plugins.DistributedMPITrainingTask) +} + +void DistributedMPITrainingTask::SharedCtor() { + ::memset(&num_workers_, 0, static_cast( + reinterpret_cast(&slots_) - + reinterpret_cast(&num_workers_)) + sizeof(slots_)); +} + +DistributedMPITrainingTask::~DistributedMPITrainingTask() { + // @@protoc_insertion_point(destructor:flyteidl.plugins.DistributedMPITrainingTask) + SharedDtor(); +} + +void DistributedMPITrainingTask::SharedDtor() { +} + +void DistributedMPITrainingTask::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const DistributedMPITrainingTask& DistributedMPITrainingTask::default_instance() { + ::google::protobuf::internal::InitSCC(&::scc_info_DistributedMPITrainingTask_flyteidl_2fplugins_2fmpi_2eproto.base); + return *internal_default_instance(); +} + + +void DistributedMPITrainingTask::Clear() { +// @@protoc_insertion_point(message_clear_start:flyteidl.plugins.DistributedMPITrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&num_workers_, 0, static_cast( + reinterpret_cast(&slots_) - + reinterpret_cast(&num_workers_)) + sizeof(slots_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* DistributedMPITrainingTask::_InternalParse(const char* begin, const char* end, void* object, + ::google::protobuf::internal::ParseContext* ctx) { + auto msg = static_cast(object); + ::google::protobuf::int32 size; (void)size; + int depth; (void)depth; + ::google::protobuf::uint32 tag; + ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end; + auto ptr = begin; + while (ptr < end) { + ptr = ::google::protobuf::io::Parse32(ptr, &tag); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + switch (tag >> 3) { + // int32 num_workers = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual; + msg->set_num_workers(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int32 num_launcher_replicas = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual; + msg->set_num_launcher_replicas(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + // int32 slots = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) != 24) goto handle_unusual; + msg->set_slots(::google::protobuf::internal::ReadVarint(&ptr)); + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr); + break; + } + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->EndGroup(tag); + return ptr; + } + auto res = UnknownFieldParse(tag, {_InternalParse, msg}, + ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx); + ptr = res.first; + GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr); + if (res.second) return ptr; + } + } // switch + } // while + return ptr; +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool DistributedMPITrainingTask::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:flyteidl.plugins.DistributedMPITrainingTask) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // int32 num_workers = 1; + case 1: { + if (static_cast< ::google::protobuf::uint8>(tag) == (8 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_workers_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 num_launcher_replicas = 2; + case 2: { + if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &num_launcher_replicas_))); + } else { + goto handle_unusual; + } + break; + } + + // int32 slots = 3; + case 3: { + if (static_cast< ::google::protobuf::uint8>(tag) == (24 & 0xFF)) { + + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &slots_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:flyteidl.plugins.DistributedMPITrainingTask) + return true; +failure: + // @@protoc_insertion_point(parse_failure:flyteidl.plugins.DistributedMPITrainingTask) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void DistributedMPITrainingTask::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:flyteidl.plugins.DistributedMPITrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 num_workers = 1; + if (this->num_workers() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->num_workers(), output); + } + + // int32 num_launcher_replicas = 2; + if (this->num_launcher_replicas() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->num_launcher_replicas(), output); + } + + // int32 slots = 3; + if (this->slots() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->slots(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:flyteidl.plugins.DistributedMPITrainingTask) +} + +::google::protobuf::uint8* DistributedMPITrainingTask::InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:flyteidl.plugins.DistributedMPITrainingTask) + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 num_workers = 1; + if (this->num_workers() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->num_workers(), target); + } + + // int32 num_launcher_replicas = 2; + if (this->num_launcher_replicas() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->num_launcher_replicas(), target); + } + + // int32 slots = 3; + if (this->slots() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->slots(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:flyteidl.plugins.DistributedMPITrainingTask) + return target; +} + +size_t DistributedMPITrainingTask::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:flyteidl.plugins.DistributedMPITrainingTask) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int32 num_workers = 1; + if (this->num_workers() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_workers()); + } + + // int32 num_launcher_replicas = 2; + if (this->num_launcher_replicas() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->num_launcher_replicas()); + } + + // int32 slots = 3; + if (this->slots() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->slots()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void DistributedMPITrainingTask::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:flyteidl.plugins.DistributedMPITrainingTask) + GOOGLE_DCHECK_NE(&from, this); + const DistributedMPITrainingTask* source = + ::google::protobuf::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:flyteidl.plugins.DistributedMPITrainingTask) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:flyteidl.plugins.DistributedMPITrainingTask) + MergeFrom(*source); + } +} + +void DistributedMPITrainingTask::MergeFrom(const DistributedMPITrainingTask& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:flyteidl.plugins.DistributedMPITrainingTask) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.num_workers() != 0) { + set_num_workers(from.num_workers()); + } + if (from.num_launcher_replicas() != 0) { + set_num_launcher_replicas(from.num_launcher_replicas()); + } + if (from.slots() != 0) { + set_slots(from.slots()); + } +} + +void DistributedMPITrainingTask::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:flyteidl.plugins.DistributedMPITrainingTask) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DistributedMPITrainingTask::CopyFrom(const DistributedMPITrainingTask& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:flyteidl.plugins.DistributedMPITrainingTask) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DistributedMPITrainingTask::IsInitialized() const { + return true; +} + +void DistributedMPITrainingTask::Swap(DistributedMPITrainingTask* other) { + if (other == this) return; + InternalSwap(other); +} +void DistributedMPITrainingTask::InternalSwap(DistributedMPITrainingTask* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(num_workers_, other->num_workers_); + swap(num_launcher_replicas_, other->num_launcher_replicas_); + swap(slots_, other->slots_); +} + +::google::protobuf::Metadata DistributedMPITrainingTask::GetMetadata() const { + ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_flyteidl_2fplugins_2fmpi_2eproto); + return ::file_level_metadata_flyteidl_2fplugins_2fmpi_2eproto[kIndexInFileMessages]; +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> PROTOBUF_NOINLINE ::flyteidl::plugins::DistributedMPITrainingTask* Arena::CreateMaybeMessage< ::flyteidl::plugins::DistributedMPITrainingTask >(Arena* arena) { + return Arena::CreateInternal< ::flyteidl::plugins::DistributedMPITrainingTask >(arena); +} +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) +#include diff --git a/gen/pb-cpp/flyteidl/plugins/mpi.pb.h b/gen/pb-cpp/flyteidl/plugins/mpi.pb.h new file mode 100644 index 0000000000..119bb2ca98 --- /dev/null +++ b/gen/pb-cpp/flyteidl/plugins/mpi.pb.h @@ -0,0 +1,257 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/mpi.proto + +#ifndef PROTOBUF_INCLUDED_flyteidl_2fplugins_2fmpi_2eproto +#define PROTOBUF_INCLUDED_flyteidl_2fplugins_2fmpi_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3007000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_flyteidl_2fplugins_2fmpi_2eproto + +// Internal implementation detail -- do not use these members. +struct TableStruct_flyteidl_2fplugins_2fmpi_2eproto { + static const ::google::protobuf::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::ParseTable schema[1] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable serialization_table[]; + static const ::google::protobuf::uint32 offsets[]; +}; +void AddDescriptors_flyteidl_2fplugins_2fmpi_2eproto(); +namespace flyteidl { +namespace plugins { +class DistributedMPITrainingTask; +class DistributedMPITrainingTaskDefaultTypeInternal; +extern DistributedMPITrainingTaskDefaultTypeInternal _DistributedMPITrainingTask_default_instance_; +} // namespace plugins +} // namespace flyteidl +namespace google { +namespace protobuf { +template<> ::flyteidl::plugins::DistributedMPITrainingTask* Arena::CreateMaybeMessage<::flyteidl::plugins::DistributedMPITrainingTask>(Arena*); +} // namespace protobuf +} // namespace google +namespace flyteidl { +namespace plugins { + +// =================================================================== + +class DistributedMPITrainingTask final : + public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:flyteidl.plugins.DistributedMPITrainingTask) */ { + public: + DistributedMPITrainingTask(); + virtual ~DistributedMPITrainingTask(); + + DistributedMPITrainingTask(const DistributedMPITrainingTask& from); + + inline DistributedMPITrainingTask& operator=(const DistributedMPITrainingTask& from) { + CopyFrom(from); + return *this; + } + #if LANG_CXX11 + DistributedMPITrainingTask(DistributedMPITrainingTask&& from) noexcept + : DistributedMPITrainingTask() { + *this = ::std::move(from); + } + + inline DistributedMPITrainingTask& operator=(DistributedMPITrainingTask&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + #endif + static const ::google::protobuf::Descriptor* descriptor() { + return default_instance().GetDescriptor(); + } + static const DistributedMPITrainingTask& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const DistributedMPITrainingTask* internal_default_instance() { + return reinterpret_cast( + &_DistributedMPITrainingTask_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(DistributedMPITrainingTask* other); + friend void swap(DistributedMPITrainingTask& a, DistributedMPITrainingTask& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline DistributedMPITrainingTask* New() const final { + return CreateMaybeMessage(nullptr); + } + + DistributedMPITrainingTask* New(::google::protobuf::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::google::protobuf::Message& from) final; + void MergeFrom(const ::google::protobuf::Message& from) final; + void CopyFrom(const DistributedMPITrainingTask& from); + void MergeFrom(const DistributedMPITrainingTask& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + static const char* _InternalParse(const char* begin, const char* end, void* object, ::google::protobuf::internal::ParseContext* ctx); + ::google::protobuf::internal::ParseFunc _ParseFunc() const final { return _InternalParse; } + #else + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const final; + ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(DistributedMPITrainingTask* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::google::protobuf::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // int32 num_workers = 1; + void clear_num_workers(); + static const int kNumWorkersFieldNumber = 1; + ::google::protobuf::int32 num_workers() const; + void set_num_workers(::google::protobuf::int32 value); + + // int32 num_launcher_replicas = 2; + void clear_num_launcher_replicas(); + static const int kNumLauncherReplicasFieldNumber = 2; + ::google::protobuf::int32 num_launcher_replicas() const; + void set_num_launcher_replicas(::google::protobuf::int32 value); + + // int32 slots = 3; + void clear_slots(); + static const int kSlotsFieldNumber = 3; + ::google::protobuf::int32 slots() const; + void set_slots(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.DistributedMPITrainingTask) + private: + class HasBitSetters; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::int32 num_workers_; + ::google::protobuf::int32 num_launcher_replicas_; + ::google::protobuf::int32 slots_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + friend struct ::TableStruct_flyteidl_2fplugins_2fmpi_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// DistributedMPITrainingTask + +// int32 num_workers = 1; +inline void DistributedMPITrainingTask::clear_num_workers() { + num_workers_ = 0; +} +inline ::google::protobuf::int32 DistributedMPITrainingTask::num_workers() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.DistributedMPITrainingTask.num_workers) + return num_workers_; +} +inline void DistributedMPITrainingTask::set_num_workers(::google::protobuf::int32 value) { + + num_workers_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.DistributedMPITrainingTask.num_workers) +} + +// int32 num_launcher_replicas = 2; +inline void DistributedMPITrainingTask::clear_num_launcher_replicas() { + num_launcher_replicas_ = 0; +} +inline ::google::protobuf::int32 DistributedMPITrainingTask::num_launcher_replicas() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.DistributedMPITrainingTask.num_launcher_replicas) + return num_launcher_replicas_; +} +inline void DistributedMPITrainingTask::set_num_launcher_replicas(::google::protobuf::int32 value) { + + num_launcher_replicas_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.DistributedMPITrainingTask.num_launcher_replicas) +} + +// int32 slots = 3; +inline void DistributedMPITrainingTask::clear_slots() { + slots_ = 0; +} +inline ::google::protobuf::int32 DistributedMPITrainingTask::slots() const { + // @@protoc_insertion_point(field_get:flyteidl.plugins.DistributedMPITrainingTask.slots) + return slots_; +} +inline void DistributedMPITrainingTask::set_slots(::google::protobuf::int32 value) { + + slots_ = value; + // @@protoc_insertion_point(field_set:flyteidl.plugins.DistributedMPITrainingTask.slots) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace plugins +} // namespace flyteidl + +// @@protoc_insertion_point(global_scope) + +#include +#endif // PROTOBUF_INCLUDED_flyteidl_2fplugins_2fmpi_2eproto diff --git a/gen/pb-go/flyteidl/plugins/mpi.pb.go b/gen/pb-go/flyteidl/plugins/mpi.pb.go new file mode 100644 index 0000000000..f09295729e --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/mpi.pb.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: flyteidl/plugins/mpi.proto + +package plugins + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// MPI operator proposal https://github.com/kubeflow/community/blob/master/proposals/mpi-operator-proposal.md +// Custom proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator +type DistributedMPITrainingTask struct { + // number of worker spawned in the cluster for this job + NumWorkers int32 `protobuf:"varint,1,opt,name=num_workers,json=numWorkers,proto3" json:"num_workers,omitempty"` + // number of launcher replicas spawned in the cluster for this job + // The launcher pod invokes mpirun and communicates with worker pods through MPI. + NumLauncherReplicas int32 `protobuf:"varint,2,opt,name=num_launcher_replicas,json=numLauncherReplicas,proto3" json:"num_launcher_replicas,omitempty"` + // number of slots per worker used in hostfile. + // The available slots (GPUs) in each pod. + Slots int32 `protobuf:"varint,3,opt,name=slots,proto3" json:"slots,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DistributedMPITrainingTask) Reset() { *m = DistributedMPITrainingTask{} } +func (m *DistributedMPITrainingTask) String() string { return proto.CompactTextString(m) } +func (*DistributedMPITrainingTask) ProtoMessage() {} +func (*DistributedMPITrainingTask) Descriptor() ([]byte, []int) { + return fileDescriptor_13cf3fae00e5b069, []int{0} +} + +func (m *DistributedMPITrainingTask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DistributedMPITrainingTask.Unmarshal(m, b) +} +func (m *DistributedMPITrainingTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DistributedMPITrainingTask.Marshal(b, m, deterministic) +} +func (m *DistributedMPITrainingTask) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributedMPITrainingTask.Merge(m, src) +} +func (m *DistributedMPITrainingTask) XXX_Size() int { + return xxx_messageInfo_DistributedMPITrainingTask.Size(m) +} +func (m *DistributedMPITrainingTask) XXX_DiscardUnknown() { + xxx_messageInfo_DistributedMPITrainingTask.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributedMPITrainingTask proto.InternalMessageInfo + +func (m *DistributedMPITrainingTask) GetNumWorkers() int32 { + if m != nil { + return m.NumWorkers + } + return 0 +} + +func (m *DistributedMPITrainingTask) GetNumLauncherReplicas() int32 { + if m != nil { + return m.NumLauncherReplicas + } + return 0 +} + +func (m *DistributedMPITrainingTask) GetSlots() int32 { + if m != nil { + return m.Slots + } + return 0 +} + +func init() { + proto.RegisterType((*DistributedMPITrainingTask)(nil), "flyteidl.plugins.DistributedMPITrainingTask") +} + +func init() { proto.RegisterFile("flyteidl/plugins/mpi.proto", fileDescriptor_13cf3fae00e5b069) } + +var fileDescriptor_13cf3fae00e5b069 = []byte{ + // 209 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x8f, 0x31, 0x4b, 0xc7, 0x30, + 0x10, 0x47, 0xa9, 0xf2, 0x77, 0x88, 0x8b, 0x44, 0x85, 0xd2, 0x45, 0x71, 0x72, 0xb1, 0x01, 0x1d, + 0xc4, 0x55, 0x5c, 0x04, 0x05, 0x29, 0x05, 0xc1, 0xa5, 0x24, 0x6d, 0x4c, 0x8f, 0x26, 0x97, 0x70, + 0x49, 0x10, 0x3f, 0x81, 0x5f, 0x5b, 0x4c, 0xab, 0x83, 0xe3, 0xdd, 0x7b, 0xc3, 0xef, 0xb1, 0xe6, + 0xdd, 0x7e, 0x26, 0x0d, 0x93, 0x15, 0xc1, 0x66, 0x03, 0x18, 0x85, 0x0b, 0xd0, 0x06, 0xf2, 0xc9, + 0xf3, 0xa3, 0x5f, 0xd6, 0x6e, 0xec, 0xe2, 0xab, 0x62, 0xcd, 0x03, 0xc4, 0x44, 0xa0, 0x72, 0xd2, + 0xd3, 0xf3, 0xcb, 0x63, 0x4f, 0x12, 0x10, 0xd0, 0xf4, 0x32, 0x2e, 0xfc, 0x8c, 0x1d, 0x62, 0x76, + 0xc3, 0x87, 0xa7, 0x45, 0x53, 0xac, 0xab, 0xf3, 0xea, 0x72, 0xd7, 0x31, 0xcc, 0xee, 0x75, 0xfd, + 0xf0, 0x6b, 0x76, 0xfa, 0x23, 0x58, 0x99, 0x71, 0x9c, 0x35, 0x0d, 0xa4, 0x83, 0x85, 0x51, 0xc6, + 0x7a, 0xaf, 0xa8, 0xc7, 0x98, 0xdd, 0xd3, 0xc6, 0xba, 0x0d, 0xf1, 0x13, 0xb6, 0x8b, 0xd6, 0xa7, + 0x58, 0xef, 0x17, 0x67, 0x3d, 0xee, 0xef, 0xde, 0x6e, 0x0d, 0xa4, 0x39, 0xab, 0x76, 0xf4, 0x4e, + 0x94, 0xa1, 0x9e, 0x8c, 0xf8, 0xab, 0x31, 0x1a, 0x45, 0x50, 0x57, 0xc6, 0x8b, 0xff, 0x81, 0xea, + 0xa0, 0xd4, 0xdd, 0x7c, 0x07, 0x00, 0x00, 0xff, 0xff, 0x76, 0x5d, 0x84, 0xbc, 0xfb, 0x00, 0x00, + 0x00, +} diff --git a/gen/pb-go/flyteidl/plugins/mpi.pb.validate.go b/gen/pb-go/flyteidl/plugins/mpi.pb.validate.go new file mode 100644 index 0000000000..c0d746eee7 --- /dev/null +++ b/gen/pb-go/flyteidl/plugins/mpi.pb.validate.go @@ -0,0 +1,110 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: flyteidl/plugins/mpi.proto + +package plugins + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/ptypes" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = ptypes.DynamicAny{} +) + +// define the regex for a UUID once up-front +var _mpi_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") + +// Validate checks the field values on DistributedMPITrainingTask with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DistributedMPITrainingTask) Validate() error { + if m == nil { + return nil + } + + // no validation rules for NumWorkers + + // no validation rules for NumLauncherReplicas + + // no validation rules for Slots + + return nil +} + +// DistributedMPITrainingTaskValidationError is the validation error returned +// by DistributedMPITrainingTask.Validate if the designated constraints aren't met. +type DistributedMPITrainingTaskValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DistributedMPITrainingTaskValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DistributedMPITrainingTaskValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DistributedMPITrainingTaskValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DistributedMPITrainingTaskValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DistributedMPITrainingTaskValidationError) ErrorName() string { + return "DistributedMPITrainingTaskValidationError" +} + +// Error satisfies the builtin error interface +func (e DistributedMPITrainingTaskValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDistributedMPITrainingTask.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DistributedMPITrainingTaskValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DistributedMPITrainingTaskValidationError{} diff --git a/gen/pb-java/flyteidl/plugins/Mpi.java b/gen/pb-java/flyteidl/plugins/Mpi.java new file mode 100644 index 0000000000..8adb21af9e --- /dev/null +++ b/gen/pb-java/flyteidl/plugins/Mpi.java @@ -0,0 +1,737 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: flyteidl/plugins/mpi.proto + +package flyteidl.plugins; + +public final class Mpi { + private Mpi() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface DistributedMPITrainingTaskOrBuilder extends + // @@protoc_insertion_point(interface_extends:flyteidl.plugins.DistributedMPITrainingTask) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * number of worker spawned in the cluster for this job
+     * 
+ * + * int32 num_workers = 1; + */ + int getNumWorkers(); + + /** + *
+     * number of launcher replicas spawned in the cluster for this job
+     * The launcher pod invokes mpirun and communicates with worker pods through MPI.
+     * 
+ * + * int32 num_launcher_replicas = 2; + */ + int getNumLauncherReplicas(); + + /** + *
+     * number of slots per worker used in hostfile.
+     * The available slots (GPUs) in each pod.
+     * 
+ * + * int32 slots = 3; + */ + int getSlots(); + } + /** + *
+   * MPI operator proposal https://github.com/kubeflow/community/blob/master/proposals/mpi-operator-proposal.md
+   * Custom proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator
+   * 
+ * + * Protobuf type {@code flyteidl.plugins.DistributedMPITrainingTask} + */ + public static final class DistributedMPITrainingTask extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:flyteidl.plugins.DistributedMPITrainingTask) + DistributedMPITrainingTaskOrBuilder { + private static final long serialVersionUID = 0L; + // Use DistributedMPITrainingTask.newBuilder() to construct. + private DistributedMPITrainingTask(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DistributedMPITrainingTask() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DistributedMPITrainingTask( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + numWorkers_ = input.readInt32(); + break; + } + case 16: { + + numLauncherReplicas_ = input.readInt32(); + break; + } + case 24: { + + slots_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.Mpi.internal_static_flyteidl_plugins_DistributedMPITrainingTask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.Mpi.internal_static_flyteidl_plugins_DistributedMPITrainingTask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.Mpi.DistributedMPITrainingTask.class, flyteidl.plugins.Mpi.DistributedMPITrainingTask.Builder.class); + } + + public static final int NUM_WORKERS_FIELD_NUMBER = 1; + private int numWorkers_; + /** + *
+     * number of worker spawned in the cluster for this job
+     * 
+ * + * int32 num_workers = 1; + */ + public int getNumWorkers() { + return numWorkers_; + } + + public static final int NUM_LAUNCHER_REPLICAS_FIELD_NUMBER = 2; + private int numLauncherReplicas_; + /** + *
+     * number of launcher replicas spawned in the cluster for this job
+     * The launcher pod invokes mpirun and communicates with worker pods through MPI.
+     * 
+ * + * int32 num_launcher_replicas = 2; + */ + public int getNumLauncherReplicas() { + return numLauncherReplicas_; + } + + public static final int SLOTS_FIELD_NUMBER = 3; + private int slots_; + /** + *
+     * number of slots per worker used in hostfile.
+     * The available slots (GPUs) in each pod.
+     * 
+ * + * int32 slots = 3; + */ + public int getSlots() { + return slots_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (numWorkers_ != 0) { + output.writeInt32(1, numWorkers_); + } + if (numLauncherReplicas_ != 0) { + output.writeInt32(2, numLauncherReplicas_); + } + if (slots_ != 0) { + output.writeInt32(3, slots_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numWorkers_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, numWorkers_); + } + if (numLauncherReplicas_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, numLauncherReplicas_); + } + if (slots_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, slots_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof flyteidl.plugins.Mpi.DistributedMPITrainingTask)) { + return super.equals(obj); + } + flyteidl.plugins.Mpi.DistributedMPITrainingTask other = (flyteidl.plugins.Mpi.DistributedMPITrainingTask) obj; + + if (getNumWorkers() + != other.getNumWorkers()) return false; + if (getNumLauncherReplicas() + != other.getNumLauncherReplicas()) return false; + if (getSlots() + != other.getSlots()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NUM_WORKERS_FIELD_NUMBER; + hash = (53 * hash) + getNumWorkers(); + hash = (37 * hash) + NUM_LAUNCHER_REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getNumLauncherReplicas(); + hash = (37 * hash) + SLOTS_FIELD_NUMBER; + hash = (53 * hash) + getSlots(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(flyteidl.plugins.Mpi.DistributedMPITrainingTask prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * MPI operator proposal https://github.com/kubeflow/community/blob/master/proposals/mpi-operator-proposal.md
+     * Custom proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator
+     * 
+ * + * Protobuf type {@code flyteidl.plugins.DistributedMPITrainingTask} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:flyteidl.plugins.DistributedMPITrainingTask) + flyteidl.plugins.Mpi.DistributedMPITrainingTaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return flyteidl.plugins.Mpi.internal_static_flyteidl_plugins_DistributedMPITrainingTask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return flyteidl.plugins.Mpi.internal_static_flyteidl_plugins_DistributedMPITrainingTask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + flyteidl.plugins.Mpi.DistributedMPITrainingTask.class, flyteidl.plugins.Mpi.DistributedMPITrainingTask.Builder.class); + } + + // Construct using flyteidl.plugins.Mpi.DistributedMPITrainingTask.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + numWorkers_ = 0; + + numLauncherReplicas_ = 0; + + slots_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return flyteidl.plugins.Mpi.internal_static_flyteidl_plugins_DistributedMPITrainingTask_descriptor; + } + + @java.lang.Override + public flyteidl.plugins.Mpi.DistributedMPITrainingTask getDefaultInstanceForType() { + return flyteidl.plugins.Mpi.DistributedMPITrainingTask.getDefaultInstance(); + } + + @java.lang.Override + public flyteidl.plugins.Mpi.DistributedMPITrainingTask build() { + flyteidl.plugins.Mpi.DistributedMPITrainingTask result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public flyteidl.plugins.Mpi.DistributedMPITrainingTask buildPartial() { + flyteidl.plugins.Mpi.DistributedMPITrainingTask result = new flyteidl.plugins.Mpi.DistributedMPITrainingTask(this); + result.numWorkers_ = numWorkers_; + result.numLauncherReplicas_ = numLauncherReplicas_; + result.slots_ = slots_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof flyteidl.plugins.Mpi.DistributedMPITrainingTask) { + return mergeFrom((flyteidl.plugins.Mpi.DistributedMPITrainingTask)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(flyteidl.plugins.Mpi.DistributedMPITrainingTask other) { + if (other == flyteidl.plugins.Mpi.DistributedMPITrainingTask.getDefaultInstance()) return this; + if (other.getNumWorkers() != 0) { + setNumWorkers(other.getNumWorkers()); + } + if (other.getNumLauncherReplicas() != 0) { + setNumLauncherReplicas(other.getNumLauncherReplicas()); + } + if (other.getSlots() != 0) { + setSlots(other.getSlots()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + flyteidl.plugins.Mpi.DistributedMPITrainingTask parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (flyteidl.plugins.Mpi.DistributedMPITrainingTask) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int numWorkers_ ; + /** + *
+       * number of worker spawned in the cluster for this job
+       * 
+ * + * int32 num_workers = 1; + */ + public int getNumWorkers() { + return numWorkers_; + } + /** + *
+       * number of worker spawned in the cluster for this job
+       * 
+ * + * int32 num_workers = 1; + */ + public Builder setNumWorkers(int value) { + + numWorkers_ = value; + onChanged(); + return this; + } + /** + *
+       * number of worker spawned in the cluster for this job
+       * 
+ * + * int32 num_workers = 1; + */ + public Builder clearNumWorkers() { + + numWorkers_ = 0; + onChanged(); + return this; + } + + private int numLauncherReplicas_ ; + /** + *
+       * number of launcher replicas spawned in the cluster for this job
+       * The launcher pod invokes mpirun and communicates with worker pods through MPI.
+       * 
+ * + * int32 num_launcher_replicas = 2; + */ + public int getNumLauncherReplicas() { + return numLauncherReplicas_; + } + /** + *
+       * number of launcher replicas spawned in the cluster for this job
+       * The launcher pod invokes mpirun and communicates with worker pods through MPI.
+       * 
+ * + * int32 num_launcher_replicas = 2; + */ + public Builder setNumLauncherReplicas(int value) { + + numLauncherReplicas_ = value; + onChanged(); + return this; + } + /** + *
+       * number of launcher replicas spawned in the cluster for this job
+       * The launcher pod invokes mpirun and communicates with worker pods through MPI.
+       * 
+ * + * int32 num_launcher_replicas = 2; + */ + public Builder clearNumLauncherReplicas() { + + numLauncherReplicas_ = 0; + onChanged(); + return this; + } + + private int slots_ ; + /** + *
+       * number of slots per worker used in hostfile.
+       * The available slots (GPUs) in each pod.
+       * 
+ * + * int32 slots = 3; + */ + public int getSlots() { + return slots_; + } + /** + *
+       * number of slots per worker used in hostfile.
+       * The available slots (GPUs) in each pod.
+       * 
+ * + * int32 slots = 3; + */ + public Builder setSlots(int value) { + + slots_ = value; + onChanged(); + return this; + } + /** + *
+       * number of slots per worker used in hostfile.
+       * The available slots (GPUs) in each pod.
+       * 
+ * + * int32 slots = 3; + */ + public Builder clearSlots() { + + slots_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:flyteidl.plugins.DistributedMPITrainingTask) + } + + // @@protoc_insertion_point(class_scope:flyteidl.plugins.DistributedMPITrainingTask) + private static final flyteidl.plugins.Mpi.DistributedMPITrainingTask DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new flyteidl.plugins.Mpi.DistributedMPITrainingTask(); + } + + public static flyteidl.plugins.Mpi.DistributedMPITrainingTask getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DistributedMPITrainingTask parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DistributedMPITrainingTask(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public flyteidl.plugins.Mpi.DistributedMPITrainingTask getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_flyteidl_plugins_DistributedMPITrainingTask_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_flyteidl_plugins_DistributedMPITrainingTask_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\032flyteidl/plugins/mpi.proto\022\020flyteidl.p" + + "lugins\"_\n\032DistributedMPITrainingTask\022\023\n\013" + + "num_workers\030\001 \001(\005\022\035\n\025num_launcher_replic" + + "as\030\002 \001(\005\022\r\n\005slots\030\003 \001(\005B9Z7github.com/fl" + + "yteorg/flyteidl/gen/pb-go/flyteidl/plugi" + + "nsb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_flyteidl_plugins_DistributedMPITrainingTask_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_flyteidl_plugins_DistributedMPITrainingTask_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_flyteidl_plugins_DistributedMPITrainingTask_descriptor, + new java.lang.String[] { "NumWorkers", "NumLauncherReplicas", "Slots", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gen/pb_python/flyteidl/plugins/mpi_pb2.py b/gen/pb_python/flyteidl/plugins/mpi_pb2.py new file mode 100644 index 0000000000..5474eaa8f0 --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/mpi_pb2.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: flyteidl/plugins/mpi.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='flyteidl/plugins/mpi.proto', + package='flyteidl.plugins', + syntax='proto3', + serialized_options=_b('Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins'), + serialized_pb=_b('\n\x1a\x66lyteidl/plugins/mpi.proto\x12\x10\x66lyteidl.plugins\"_\n\x1a\x44istributedMPITrainingTask\x12\x13\n\x0bnum_workers\x18\x01 \x01(\x05\x12\x1d\n\x15num_launcher_replicas\x18\x02 \x01(\x05\x12\r\n\x05slots\x18\x03 \x01(\x05\x42\x39Z7github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/pluginsb\x06proto3') +) + + + + +_DISTRIBUTEDMPITRAININGTASK = _descriptor.Descriptor( + name='DistributedMPITrainingTask', + full_name='flyteidl.plugins.DistributedMPITrainingTask', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='num_workers', full_name='flyteidl.plugins.DistributedMPITrainingTask.num_workers', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='num_launcher_replicas', full_name='flyteidl.plugins.DistributedMPITrainingTask.num_launcher_replicas', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='slots', full_name='flyteidl.plugins.DistributedMPITrainingTask.slots', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=48, + serialized_end=143, +) + +DESCRIPTOR.message_types_by_name['DistributedMPITrainingTask'] = _DISTRIBUTEDMPITRAININGTASK +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +DistributedMPITrainingTask = _reflection.GeneratedProtocolMessageType('DistributedMPITrainingTask', (_message.Message,), dict( + DESCRIPTOR = _DISTRIBUTEDMPITRAININGTASK, + __module__ = 'flyteidl.plugins.mpi_pb2' + # @@protoc_insertion_point(class_scope:flyteidl.plugins.DistributedMPITrainingTask) + )) +_sym_db.RegisterMessage(DistributedMPITrainingTask) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/gen/pb_python/flyteidl/plugins/mpi_pb2_grpc.py b/gen/pb_python/flyteidl/plugins/mpi_pb2_grpc.py new file mode 100644 index 0000000000..a89435267c --- /dev/null +++ b/gen/pb_python/flyteidl/plugins/mpi_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/protos/docs/plugins/plugins.rst b/protos/docs/plugins/plugins.rst index a9deac8846..29f4953625 100644 --- a/protos/docs/plugins/plugins.rst +++ b/protos/docs/plugins/plugins.rst @@ -48,6 +48,48 @@ will be executed concurrently. +.. _ref_flyteidl/plugins/mpi.proto: + +flyteidl/plugins/mpi.proto +================================================================== + + + + + +.. _ref_flyteidl.plugins.DistributedMPITrainingTask: + +DistributedMPITrainingTask +------------------------------------------------------------------ + +MPI operator proposal https://github.com/kubeflow/community/blob/master/proposals/mpi-operator-proposal.md +Custom proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator + + + +.. csv-table:: DistributedMPITrainingTask type fields + :header: "Field", "Type", "Label", "Description" + :widths: auto + + "num_workers", ":ref:`ref_int32`", "", "number of worker spawned in the cluster for this job" + "num_launcher_replicas", ":ref:`ref_int32`", "", "number of launcher replicas spawned in the cluster for this job The launcher pod invokes mpirun and communicates with worker pods through MPI." + "slots", ":ref:`ref_int32`", "", "number of slots per worker used in hostfile. The available slots (GPUs) in each pod." + + + + + + + + + + + + + + + + .. _ref_flyteidl/plugins/presto.proto: flyteidl/plugins/presto.proto diff --git a/protos/flyteidl/plugins/mpi.proto b/protos/flyteidl/plugins/mpi.proto new file mode 100644 index 0000000000..8467d3de01 --- /dev/null +++ b/protos/flyteidl/plugins/mpi.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package flyteidl.plugins; + +option go_package = "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/plugins"; + +// MPI operator proposal https://github.com/kubeflow/community/blob/master/proposals/mpi-operator-proposal.md +// Custom proto for plugin that enables distributed training using https://github.com/kubeflow/mpi-operator +message DistributedMPITrainingTask { + // number of worker spawned in the cluster for this job + int32 num_workers = 1; + + // number of launcher replicas spawned in the cluster for this job + // The launcher pod invokes mpirun and communicates with worker pods through MPI. + int32 num_launcher_replicas = 2; + + // number of slots per worker used in hostfile. + // The available slots (GPUs) in each pod. + int32 slots = 3; +} \ No newline at end of file