⚡ Free Classes and Scholarships Available for Underprivileged Students -

Training models

Scaling Prototypes into ML Models

Set 1
10 Questions
No time limit
Practice Mode
0%
Score
0
Correct
0
Incorrect
10
Total Questions
Back to Topics
Question 1 of 10
You need to train a custom image classification model on Vertex AI using 500 GB of image data stored in Cloud Storage. Your training job keeps failing with out-of-memory errors during data loading. The model architecture and batch size are already optimized. What should you do to resolve this issue?
Explanation
Option D (Enable sharding in your data loader and use interleaved reading from multiple files) is correct because this approach distributes the data loading across multiple workers and prevents loading the entire dataset into memory at once. Sharding splits the dataset into smaller chunks that can be processed in parallel, while interleaved reading ensures efficient I/O operations without overwhelming memory. Option B is incorrect because while prefetch and cache improve performance, cache tries to store data in memory which would worsen the OOM issue. Option A is incorrect because the problem is specifically with data loading during ingestion, not model training memory requirements; adding more memory is costly and doesn't address the root cause of inefficient data loading. Option C is incorrect because while TFRecord format can improve performance, reducing image resolution changes the input data quality and may not be necessary when proper data sharding is implemented.
Question 2 of 10
Your team is training a large language model on Vertex AI and needs to perform hyperparameter tuning across learning rate, batch size, and number of layers. You have a limited budget and need results within 48 hours. Which hyperparameter tuning strategy should you use?
Explanation
Option C (Bayesian optimization with a maximum of 50 trials and early stopping) is correct because Bayesian optimization intelligently selects the next hyperparameter combinations based on previous results, making it more efficient than random or grid search for finding optimal values within budget and time constraints. Early stopping further reduces cost by terminating unpromising trials. Option D is incorrect because grid search exhaustively tests all combinations, which is computationally expensive and time-consuming, especially with three hyperparameters, and would likely exceed the 48-hour and budget constraints. Option A is incorrect because random search with 100 trials doesn't leverage information from previous trials and would likely be more expensive and slower than Bayesian optimization for the same quality of results. Option B is incorrect because manual tuning is inefficient, doesn't scale well, and is unlikely to explore the parameter space effectively within 48 hours.
Question 3 of 10
You are ingesting training data from multiple sources: CSV files in Cloud Storage, streaming data from Pub/Sub, and historical records in BigQuery. You need to create a unified pipeline for a tabular model on Vertex AI. What is the most efficient approach?
Explanation
Option B (Use Dataflow to read all sources and write unified data to BigQuery for training) is correct because Dataflow can efficiently handle batch and streaming data from multiple sources, perform necessary transformations, and consolidate everything into BigQuery, which Vertex AI can directly consume for training tabular models. This provides a unified, scalable ETL solution. Option A is incorrect because Vertex AI doesn't support combining multiple datasets with different formats during training; data must be unified beforehand into a single source. Option C is incorrect because this approach requires manual conversion of streaming Pub/Sub and BigQuery data to CSV, adding unnecessary complexity and losing the benefits of BigQuery's native integration with Vertex AI. Option D is incorrect because routing all data through Pub/Sub adds unnecessary latency for batch data already in Cloud Storage and BigQuery, and Cloud Functions aren't designed for large-scale data processing.
Question 4 of 10
Your training job on Vertex AI using a custom container fails after 2 hours with a 'training application error' message. The logs show the error occurred during model checkpoint saving. What is the most likely cause and solution?
Explanation
Option A (Missing IAM permissions; grant Storage Object Admin role to the service account) is correct because checkpoint saving failures typically occur when the training job's service account lacks permissions to write to Cloud Storage. The Storage Object Admin role provides the necessary write permissions for saving checkpoints. Option C is incorrect because GPU memory issues would cause failures during forward/backward passes or batch processing, not specifically during checkpoint saving operations. Option D is incorrect because network timeout issues would typically show connection-related errors rather than application errors, and timeout configuration affects how long jobs can run, not checkpoint saving. Option B is incorrect because TensorFlow version incompatibilities would cause failures during model building or training initialization, not specifically during the checkpoint saving phase.
Question 5 of 10
You need to fine-tune a PaLM 2 model from Model Garden for a domain-specific text classification task with 10,000 labeled examples. You want to minimize training time while maintaining good performance. Which approach should you use?
Explanation
Option B (Use Vertex AI supervised tuning with your labeled dataset and default hyperparameters) is correct because Vertex AI provides optimized supervised tuning specifically for foundational models like PaLM 2, which efficiently adapts the pre-trained model to your specific task with minimal time and resources while leveraging the model's existing knowledge. Option D is incorrect because while prompt engineering is fast, it won't provide the same performance as fine-tuning for a specific classification task with labeled data, especially when you have 10,000 examples available. Option C is incorrect because training from scratch requires significantly more time, computational resources, and data than fine-tuning, and won't leverage the pre-trained knowledge in PaLM 2. Option A is incorrect because AutoML Text builds models from scratch rather than fine-tuning foundational models, taking longer and not leveraging PaLM 2's capabilities.
Question 6 of 10
You are training a computer vision model using Vertex AI with video data stored as MP4 files in Cloud Storage. The training job runs but produces poor accuracy. What data preparation step is most likely missing?
Explanation
Option D (Extracting frames from videos and storing them as individual image files) is correct because most computer vision training pipelines on Vertex AI expect image inputs, not raw video files. Videos must be preprocessed to extract relevant frames before training, which is a critical step for standard vision models. Option B is incorrect because while TFRecord is an efficient format, serializing entire videos as tensors doesn't solve the fundamental issue that video files need frame extraction and the model needs to process individual frames or frame sequences. Option A is incorrect because transcoding to lower resolution might reduce training time but wouldn't address poor accuracy; in fact, it could worsen accuracy by reducing input quality. Option C is incorrect because while splitting and augmentation are useful techniques, they don't address the fundamental requirement to extract frames from video files for standard computer vision models.
Question 7 of 10
Your distributed training job on Vertex AI with 4 workers keeps failing with inconsistent results across runs. The logs show 'parameter server connection timeout' errors. The model trains successfully on a single machine. What should you do?
Explanation
Option C (Switch to MirroredStrategy or MultiWorkerMirroredStrategy for synchronous training) is correct because parameter server connection issues often indicate problems with the asynchronous parameter server architecture. Using synchronous strategies like MirroredStrategy eliminates the parameter server pattern, using all-reduce for gradient aggregation, which is more reliable and provides consistent results. Option B is incorrect because gradient checkpointing addresses memory issues during training, not distributed training communication or consistency problems. Option D is incorrect because adding more parameter servers would increase complexity and communication overhead without addressing the fundamental reliability issues with the parameter server architecture. Option A is incorrect because while retry logic might temporarily mask the issue, it doesn't solve the underlying architectural problem causing timeouts and inconsistent results.
Question 8 of 10
You need to train a tabular classification model using Vertex AI with data in BigQuery containing 100 million rows and 200 features. You want to minimize operational overhead. Which training approach should you use?
Explanation
Option A (Use Vertex AI AutoML Tables directly with the BigQuery table) is correct because AutoML Tables is specifically designed for tabular data, can directly consume BigQuery tables without data export, handles feature engineering automatically, and requires minimal operational overhead while being optimized for large datasets. Option C is incorrect because exporting 100 million rows to CSV creates unnecessary data movement, storage costs, and operational complexity when Vertex AI can directly access BigQuery. Option B is incorrect because Kubeflow pipelines on GKE require significant operational overhead including cluster management, pipeline development, and infrastructure maintenance, which contradicts the requirement to minimize operational overhead. Option D is incorrect because while BigQuery ML reduces operational overhead, Vertex AI AutoML Tables typically provides better model quality and more advanced features for complex classification tasks.
Question 9 of 10
Your Vertex AI training job for an NLP model processes text data from Cloud Storage. Training is slower than expected, and you notice high I/O wait times. The dataset contains 50,000 JSON files with varying document lengths. How should you optimize data ingestion?
Explanation
Option A (Consolidate JSON files into fewer larger files and use parallel reading) is correct because having 50,000 small files creates excessive I/O overhead from metadata operations and connection establishment. Consolidating into larger files (ideally in the 100MB-1GB range) reduces the number of operations while maintaining parallelism through multi-threaded reading within files. Option B is incorrect because versioning and lifecycle policies manage object versions and retention but don't improve read performance or reduce I/O wait times during training. Option C is incorrect because Nearline storage is designed for infrequent access and actually has higher latency and retrieval costs compared to Standard storage, which would worsen training performance. Option D is incorrect because while local caching might help with repeated reads, it requires managing disk space and doesn't address the fundamental inefficiency of reading 50,000 separate files from Cloud Storage.
Question 10 of 10
You are training a speech recognition model on Vertex AI using audio files stored in Cloud Storage. The training fails with 'unsupported audio format' errors for some files. Your dataset contains WAV, MP3, and FLAC files. What is the best solution?
Explanation
Option C (Preprocess all audio to a consistent format using Dataflow before training) is correct because Dataflow provides a scalable, managed solution to process large audio datasets, convert them to a consistent format, and prepare them for training. This separates data preparation from training, making the pipeline more reliable and maintainable. Option A is incorrect because filtering out formats wastes potentially valuable training data (MP3 and FLAC files) and reduces the dataset size, which could negatively impact model performance. Option D is incorrect because Cloud Functions have time and memory limitations that make them unsuitable for processing large audio files at scale; they're designed for lightweight, event-driven tasks. Option B is incorrect because adding multi-format handling to training code increases complexity, creates tight coupling between data processing and training, and doesn't address the root issue that the model framework may not natively support all formats.