Class DeviceMesh
java.lang.Object
smile.llm.parallel.DeviceMesh
Maps logical mesh coordinates to CUDA devices (phase 1) or process ranks
(phase 2 multi-node).
-
Constructor Summary
ConstructorsConstructorDescriptionDeviceMesh(ParallelConfig config) Creates a device mesh for the given parallel configuration. -
Method Summary
Modifier and TypeMethodDescriptionconfig()Returns the underlying parallel configuration.device(int tpRank) Device for a TP rank within the local (pp=0) stage.device(ParallelState state) Device for this parallel state.
-
Constructor Details
-
DeviceMesh
Creates a device mesh for the given parallel configuration.- Parameters:
config- process-mesh configuration.
-
-
Method Details
-
config
-
device
Device for a TP rank within the local (pp=0) stage.- Parameters:
tpRank- tensor-parallel rank.- Returns:
- CUDA device for that rank.
-
device
Device for this parallel state.- Parameters:
state- per-rank parallel state.- Returns:
- CUDA device for
state.
-