Class ShardingConfig
Configuration for model sharding.
public class ShardingConfig
- Inheritance
-
ShardingConfig
- Inherited Members
Properties
CustomDeviceAssignments
Custom device assignments when using ShardingStrategy.Custom. Index is layer index, value is device index.
public int[]? CustomDeviceAssignments { get; set; }
Property Value
- int[]
MaxMemoryPerDevice
Memory limit per device in bytes (for memory-balanced sharding).
public long? MaxMemoryPerDevice { get; set; }
Property Value
- long?
MicroBatchCount
Number of micro-batches for pipeline parallelism.
public int MicroBatchCount { get; set; }
Property Value
Remarks
Higher values improve GPU utilization but increase memory usage. Typical values: 4-8 for most models.
Strategy
Strategy for distributing layers across devices.
public ShardingStrategy Strategy { get; set; }
Property Value
UsePipelineParallelism
Whether to use pipeline parallelism for overlapping compute and transfer.
public bool UsePipelineParallelism { get; set; }