25 #ifndef TVM_RELAX_DISTRIBUTED_STRUCT_INFO_H_
26 #define TVM_RELAX_DISTRIBUTED_STRUCT_INFO_H_
32 namespace distributed {
49 refl::ObjectDef<PlacementSpecNode>()
107 TVM_DLL
explicit Placement(ffi::Array<PlacementSpec> dim_specs);
133 refl::ObjectDef<DTensorStructInfoNode>()
Container of constant int that adds more constructors.
Definition: expr.h:600
Definition: source_map.h:111
Base type of all structure information.
Definition: expr.h:108
Managed reference to StructInfoNode.
Definition: expr.h:132
Managed reference to TensorStructInfoNode.
Definition: struct_info.h:190
StructInfo of DTensor (Distributed Tensor).
Definition: struct_info.h:116
TensorStructInfo tensor_sinfo
The struct info inherited from TensorStructInfo.
Definition: struct_info.h:121
Placement placement
The placement of the tensor among the device mesh.
Definition: struct_info.h:129
DeviceMesh device_mesh
The device mesh of the tensor.
Definition: struct_info.h:125
static void RegisterReflection()
Definition: struct_info.h:131
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.DTensorStructInfo", DTensorStructInfoNode, StructInfoNode)
Managed reference to DTensorStructInfoNode.
Definition: struct_info.h:146
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(DTensorStructInfo, StructInfo, DTensorStructInfoNode)
DTensorStructInfo(TensorStructInfo tensor_sinfo, DeviceMesh device_mesh, Placement placement, Span span=Span())
Construction with device mesh and placement.
Managed reference to a DeviceMesh.
Definition: global_info.h:62
Describes how data is distributed in each dimension of the device mesh.
Definition: struct_info.h:85
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: struct_info.h:97
ffi::Array< PlacementSpec > dim_specs
specs for each dim of device mesh.
Definition: struct_info.h:88
ffi::String ToString() const
static void RegisterReflection()
Definition: struct_info.h:92
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.distributed.Placement", PlacementNode, Object)
Describes how data is distributed in one dimension of the device mesh.
Definition: struct_info.h:37
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: struct_info.h:54
PlacementSpecKind kind
The kind of placement spec. Possible values: kSharding and kReplica.
Definition: struct_info.h:45
TVM_FFI_DECLARE_OBJECT_INFO("relax.distributed.PlacementSpec", PlacementSpecNode, Object)
static void RegisterReflection()
Definition: struct_info.h:47
int axis
If the kind is sharding, this value represents the tensor dimension to shard. otherwise,...
Definition: struct_info.h:42
Managed reference to PlacementSpecNode.
Definition: struct_info.h:62
static PlacementSpec Replica()
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(PlacementSpec, ObjectRef, PlacementSpecNode)
static PlacementSpec Sharding(int axis)
Managed reference to a Placement.
Definition: struct_info.h:105
static Placement FromText(ffi::String text_repr)
replica dim is printed as "R" and sharding dim is printed as "S[i]".]
Placement(ffi::Array< PlacementSpec > dim_specs)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Placement, ObjectRef, PlacementNode)
Definition: struct_info.h:71
static void RegisterReflection()
Definition: struct_info.h:76
Integer sharding_dim
The dimension of tensor we shard.
Definition: struct_info.h:74
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.distributed.Sharding", ShardingNode, PlacementSpecNode)
Definition: repr_printer.h:91
PlacementSpecKind
Definition: struct_info.h:34
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
Data structure for distributed inference.