All Products
Search
Document Center

Platform For AI:Parameters for PAI-TensorFlow tasks

Last Updated:Apr 01, 2026

Platform for AI (PAI) provides a PAI-TensorFlow deep learning framework that supports single-node and distributed training. This reference covers the command parameters and I/O parameters for running PAI-TensorFlow tasks.

Warning

GPU-accelerated servers will be phased out. Submit TensorFlow tasks on CPU servers only. To train models on GPU instances, use Deep Learning Containers (DLC) instead. See Submit training jobs.

Commands and parameters

Run PAI-TensorFlow tasks from any of the following interfaces:

  • The MaxCompute client

  • An SQL node in the DataWorks console

  • The Machine Learning Designer page in the PAI console

  • TensorFlow components in Machine Learning Designer

All tasks use the same PAI command syntax:

pai -name tensorflow1120_ext
    -project algo_public
    -Dscript= 'oss://<bucket_name>.<oss_host>.aliyuncs.com/*.tar.gz'
    -DentryFile='entry_file.py'
    -Dbuckets='oss://<bucket_name>.<oss_host>.aliyuncs.com/<path>'
    -Dtables='odps://prj_name/tables/table_name'
    -Doutputs='odps://prj_name/tables/table_name'
    -DcheckpointDir='oss://<bucket_name>.<oss_host>.aliyuncs.com/<path>'
    -Dcluster="{\"ps\":{\"count\":1},\"worker\":{\"count\":2,\"gpu\":100}}"
    -Darn="acs:ram::******:role/aliyunodpspaidefaultrole"
    -DossHost="oss-cn-beijing-internal.aliyuncs.com"
Important

The name and project parameters have fixed values (tensorflow1120_ext and algo_public) and cannot be changed.

The following table describes all command parameters.

ParameterDescriptionExampleDefaultRequired
scriptThe TensorFlow algorithm script for the task. Accepted formats: file:///path/to/file (absolute local path), project_name/resources/resource_name, oss://..aliyuncs.com/.tar.gz, or oss://..aliyuncs.com/*.py. The script can be a local file, a local TAR package (.tar.gz, gzip-compressed), or a Python file.oss://demo-yuze.oss-cn-beijing-internal.aliyuncs.com/deepfm/deepfm.tar.gzNoneYes
entryFileThe entry script. Required when script points to a TAR package. If script is a single file, this parameter is not needed.main.pyNot required for single-file scriptsYes
bucketsThe input OSS buckets. Separate multiple buckets with commas. Each bucket path must end with a forward slash (/).oss://..aliyuncs.com/NoneNo
tablesThe input MaxCompute tables. Separate multiple tables with commas.odps:///tables/NoneNo
outputsThe output MaxCompute tables. Separate multiple tables with commas.odps:///tables/NoneNo
gpuRequiredThe number of GPUs for standalone training. 100 = 1 GPU, 200 = 2 GPUs. Set to 0 to use CPU only. For distributed training, configure GPUs through the cluster parameter instead. Available for TensorFlow 1120 only.100NoneNo
checkpointDirThe OSS path for storing TensorFlow checkpoints.oss://..aliyuncs.com/NoneNo
clusterThe distributed training configuration, as an escaped JSON string. See Cluster parameters for details.{\"ps\":{\"count\":1},\"worker\":{\"count\":2,\"gpu\":100}}NoneNo
enableDynamicClusterSpecifies whether to enable failover for individual worker nodes. When set to true, a failed worker node restarts automatically so the task can continue. Valid values: true, false.falsefalseNo
jobNameThe name of the experiment. Use a descriptive name (not test) to make historical data searchable and performance analysis meaningful.jk_wdl_online_jobNoneYes
maxHungTimeBeforeGCInSecondsThe maximum duration (in seconds) a GPU can remain suspended before automatic reclamation. Set to 0 to disable automatic reclamation.36003600No
ossHostThe OSS endpoint. See Regions and endpoints for valid values.oss-cn-beijing-internal.aliyuncs.comNoneNo

Cluster parameters

Use the cluster parameter to configure distributed training across parameter servers (PSs) and workers. The value must be a JSON object with escaped quotation marks. Example:

{
  "ps": {
    "count": 2
  },
  "worker": {
    "count": 4
  }
}

The JSON object supports two keys: ps (parameter server) and worker. Each key accepts the following sub-parameters.

ParameterDescriptionDefaultRequired
countThe number of PSs or workers.NoneYes
gpuThe number of GPUs per PS or worker. 100 = 1 GPU. Set to 0 under worker to use CPU clusters with no GPU consumption.0 for PS; 100 for workerNo
cpuThe number of CPU cores per PS or worker. 100 = 1 CPU core.600No
memoryThe memory per PS or worker, in MB. 100 = 100 MB.30000No

I/O parameters

The following table describes the I/O parameters for PAI-TensorFlow tasks.

ParameterDescription
tablesThe MaxCompute table path to read data from.
outputsThe MaxCompute table path to write data to. Separate multiple paths with commas. Path formats: <br>- Non-partitioned table: odps://<prj_name>/tables/<table_name> <br>- Partitioned table: odps://<proj_name>/tables/<table_name>/<pt_key1=v1> <br>- Multi-level partitioned table: odps://<prj_name>/tables/<table_name>/<pt_key1=v1>/<pt_key2=v2>
bucketsThe OSS bucket that stores objects for the algorithm to read. Reading from OSS requires the role_arn and host parameters. To get the role_arn value, go to the PAI console, navigate to Dependent Services, find OSS in the Designer section, and click View authorization. See Grant the permissions required to use Machine Learning Designer for details.
checkpointDirThe OSS bucket path to write output data to.