Enum DataService.ProcessingModeDef.ShardingPolicy

java.lang.Object
java.lang.Enum<DataService.ProcessingModeDef.ShardingPolicy>
org.tensorflow.proto.data.DataService.ProcessingModeDef.ShardingPolicy
All Implemented Interfaces:
Internal.EnumLite, ProtocolMessageEnum, Serializable, Comparable<DataService.ProcessingModeDef.ShardingPolicy>
Enclosing class:
DataService.ProcessingModeDef

public static enum DataService.ProcessingModeDef.ShardingPolicy extends Enum<DataService.ProcessingModeDef.ShardingPolicy> implements ProtocolMessageEnum
Specifies how data is sharded among tf.data service workers.
Protobuf enum tensorflow.data.ProcessingModeDef.ShardingPolicy
  • Enum Constant Details

    • OFF

      No sharding will be performed. Each worker produces the entire dataset
      without any sharding. With this mode, the best practice is to shuffle the
      dataset nondeterministically so that workers process the dataset in
      different orders.
      
      OFF = 0;
    • DYNAMIC

      public static final DataService.ProcessingModeDef.ShardingPolicy DYNAMIC
      The input dataset is dynamically split among workers at runtime. Each
      worker gets the next split when it reads data from the dispatcher. There
      is no fixed sharding with this mode.
      
      DYNAMIC = 1;
    • FILE

      The following are static sharding policies. The semantics are similar to
      `tf.data.experimental.AutoShardPolicy`. These policies require:
      * The tf.data service cluster has a fixed size, and you need to specify
        the workers in DispatcherConfig.
      * Each client only reads from the local tf.data service worker.
      Shards by input files (each worker will get a set of files to process).
      When this option is selected, make sure that there is at least as many
      files as workers. If there are fewer input files than workers, a runtime
      error will be raised.
      
      FILE = 2;
    • DATA

      Shards by elements produced by the dataset. Each worker will process the
      whole dataset and discard the portion that is not for itself. Note that
      for this mode to correctly partitions the dataset elements, the dataset
      needs to produce elements in a deterministic order.
      
      DATA = 3;
    • FILE_OR_DATA

      public static final DataService.ProcessingModeDef.ShardingPolicy FILE_OR_DATA
      Attempts FILE-based sharding, falling back to DATA-based sharding on
      failures.
      
      FILE_OR_DATA = 4;
    • HINT

      Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a
      placeholder to replace with `shard(num_workers, worker_index)`.
      
      HINT = 5;
    • UNRECOGNIZED

      public static final DataService.ProcessingModeDef.ShardingPolicy UNRECOGNIZED
  • Field Details

    • OFF_VALUE

      public static final int OFF_VALUE
      No sharding will be performed. Each worker produces the entire dataset
      without any sharding. With this mode, the best practice is to shuffle the
      dataset nondeterministically so that workers process the dataset in
      different orders.
      
      OFF = 0;
      See Also:
    • DYNAMIC_VALUE

      public static final int DYNAMIC_VALUE
      The input dataset is dynamically split among workers at runtime. Each
      worker gets the next split when it reads data from the dispatcher. There
      is no fixed sharding with this mode.
      
      DYNAMIC = 1;
      See Also:
    • FILE_VALUE

      public static final int FILE_VALUE
      The following are static sharding policies. The semantics are similar to
      `tf.data.experimental.AutoShardPolicy`. These policies require:
      * The tf.data service cluster has a fixed size, and you need to specify
        the workers in DispatcherConfig.
      * Each client only reads from the local tf.data service worker.
      Shards by input files (each worker will get a set of files to process).
      When this option is selected, make sure that there is at least as many
      files as workers. If there are fewer input files than workers, a runtime
      error will be raised.
      
      FILE = 2;
      See Also:
    • DATA_VALUE

      public static final int DATA_VALUE
      Shards by elements produced by the dataset. Each worker will process the
      whole dataset and discard the portion that is not for itself. Note that
      for this mode to correctly partitions the dataset elements, the dataset
      needs to produce elements in a deterministic order.
      
      DATA = 3;
      See Also:
    • FILE_OR_DATA_VALUE

      public static final int FILE_OR_DATA_VALUE
      Attempts FILE-based sharding, falling back to DATA-based sharding on
      failures.
      
      FILE_OR_DATA = 4;
      See Also:
    • HINT_VALUE

      public static final int HINT_VALUE
      Looks for the presence of `shard(SHARD_HINT, ...)` which is treated as a
      placeholder to replace with `shard(num_workers, worker_index)`.
      
      HINT = 5;
      See Also:
  • Method Details