‹ All MLA-C01 questions

MLA-C01 Practice Question 13: Training Input Mode

AWS Certified Machine Learning Engineer – Associate (MLA-C01) · Test 2 · question 3 of 10

Data Preparationmedium

A PyTorch training script on SageMaker AI reads a 2 TB image dataset stored as about 20,000 shard files under a single Amazon S3 prefix. The script opens the files by local path with standard file APIs. Using the default input mode, every training job spends roughly 40 minutes before the first epoch starts, and each instance needs a 2 TB storage volume. The team wants training to start almost immediately and to use much smaller volumes, without changing the script's file-reading code and without setting up any additional storage service or VPC networking.

What should the team change?

Select one answer
Show answer and explanation

Answer:

  • A. Set the training input mode to FastFile so that SageMaker AI exposes the S3 objects through a file system interface and streams their content on demand

In the default File mode, SageMaker AI downloads the entire dataset to the instance and starts training only when the download finishes, and the instance must have enough storage for the whole dataset, both symptoms in the stem. Fast file mode identifies the files at startup but does not download them; it exposes the S3 objects through a POSIX-compliant file system interface and streams content on demand as the script reads it. Training therefore starts without waiting, the dataset no longer has to fit on the instance's volume, and the script's ordinary open() calls keep working.

Option B also streams, but through a named pipe that is read as a sequential stream by a single process. The script would have to be rewritten to consume the pipe instead of opening files by path, which the stem rules out. AWS describes Pipe mode as largely replaced by the simpler Fast file mode.

Option C attacks the wrong bottleneck. File mode still waits for the full 2 TB to download, and a bigger volume is the opposite of the "much smaller volumes" requirement.

Option D would also start quickly, because mounting FSx for Lustre does not depend on dataset size, but it requires provisioning and paying for a separate file system and connecting the job to a VPC, both explicitly excluded.

Reference: Setting up training jobs to access datasets

Practice Test 2 ›

Study guides for MLA-C01