All Products
Search
Document Center

Platform For AI:Use NAS or CPFS

Last Updated:Mar 19, 2025

Deep Learning Containers (DLC), Data Science Workshop (DSW), or Elastic Algorithm Service (EAS) of Platform for AI (PAI) allows you to mount a Storage NAS (NAS) or Cloud Parallel File Storage (CPFS) dataset to a specific path for storing training and deployment files, and result files. This topic uses a general-purpose NAS file system as an example to describe how to mount a NAS or CPFS dataset in a submodule of PAI.

Prerequisites

A general-purpose NAS file system is created. For more information, see Create a file system.

Step 1: Create a NAS dataset

To mount NAS data in EAS, no additional operations are required. In DLC or DSW, you can mount a NAS dataset or directly mount NAS data. If you want to mount a NAS dataset, you must create a NAS dataset in advance. For more information, see Create and manage datasets.

Important

The region in which you create a NAS dataset must be the same as the region in which DLC instances, DSW instances, and EAS services reside, and the data and code are stored.

Parameter

Description

Dataset Configurations

Storage Type

Select General-purpose NAS.

Version Configurations

File System

The ID of the created NAS file system. You can log on to the NAS console to view the IDs of the NAS file systems in a specific region. You can also view the IDs of the NAS file systems from the drop-down list.

File System Path

The specific path to which you want to mount the NAS dataset. Set the value to /.

Default Mount Path

The mount path of the NAS dataset in DLC jobs or DSW instances. Set the value to /mnt/data/.

Step 2: Use the NAS dataset

After you create the NAS dataset, you can use the NAS dataset to read data from a NAS file system in DLC, DSW, or EAS.

Attach a NAS dataset in DLC

When you create a training job, attach NAS storage to the training job in the Environment Information section of the Create Job page. The following figure shows the key parameters. image

Parameter

Description

Data Set

Click Custom Dataset and select a general-purpose NAS dataset. After you select the dataset, the system automatically associates the mount path configured in the dataset. When you run a DLC job, the system accesses the NAS file system data from this path. You can also turn on or off Read-only to configure read and write permissions, achieving fine-grained management.

Directly Mount

Click General-purpose NAS, configure the file system-related parameters, and configure the Mount Path parameter to mount the dataset to a specific path of a DLC container. When you run a DLC job, the system accesses the NAS file system data from this path. You can also turn on or off Read-only to configure read and write permissions, achieving fine-grained management.

You can also configure the nconnect parameter in Advanced Settings to improve the throughput of DLC containers for accessing NAS. The nconnect parameter is an option for mounting an NFS file system on a Linux ECS instance. You can use this parameter to establish more TCP connections between the NFS client and the ECS instance to increase the throughput. We recommend that you set the nconnect parameter to 4. Sample code:

{"nconnect":"4"}

Attach a NAS dataset in DSW

When you create a DSW instance, you can attach the NAS dataset to the instance. The following figure shows the key parameters.image

  • Dataset Mounting: Configure the following parameters to attach the dataset.

    • Custom Dataset: Click image. On the General-purpose NAS tab of the Custom Dataset panel, select the NAS dataset.

    • Mount Path: After you select the dataset, the system automatically associates the mount path configured in the dataset. You can access the NAS file system data from this path in the DSW development environment.

  • Working Directory: You can select the dataset from the drop-down list. Then, the system synchronizes the dataset to the /mnt/workspace directory of DSW.

Attach a NAS dataset in EAS

When you deploy an EAS service, you can attach the NAS dataset to the EAS service. The following figure shows the key parameters.image

In the Environment Information section, configure Model Settings. Click Standard NAS and configure the following parameters:

  • Select a file system: Select a NAS file system.

  • Mount Target: Select a mount target. The EAS service accesses the NAS file system from this mount target.

  • File System Path: The specific path to which you want to mount the NAS dataset in a NAS instance.

  • Mount Path: The path to which you want to attach the NAS dataset to the service instance and used for reading files from NAS.