Class DeviceMesh

java.lang.Object
smile.llm.parallel.DeviceMesh

public final class DeviceMesh extends Object
Maps logical mesh coordinates to CUDA devices (phase 1) or process ranks (phase 2 multi-node).
  • Constructor Details

    • DeviceMesh

      public DeviceMesh(ParallelConfig config)
      Creates a device mesh for the given parallel configuration.
      Parameters:
      config - process-mesh configuration.
  • Method Details

    • config

      public ParallelConfig config()
      Returns the underlying parallel configuration.
      Returns:
      mesh config.
    • device

      public Device device(int tpRank)
      Device for a TP rank within the local (pp=0) stage.
      Parameters:
      tpRank - tensor-parallel rank.
      Returns:
      CUDA device for that rank.
    • device

      public Device device(ParallelState state)
      Device for this parallel state.
      Parameters:
      state - per-rank parallel state.
      Returns:
      CUDA device for state.