NCA AI & Deep Learning Frameworks 2 — Questions and Answers
Question 1: Which NVIDIA library provides GPU-accelerated primitives specifically optimized for deep neural network operations like convolutions and RNNs?
- cuBLAS
- cuDNN (Correct answer)
- NCCL
- Thrust
Correct answer: cuDNN
cuDNN (CUDA Deep Neural Network library) provides highly optimized primitives for deep learning operations including convolutions, pooling, and recurrent layers.
Question 2: In PyTorch, what is the purpose of `torch.no_grad()` context manager?
- Disables GPU acceleration
- Prevents gradient computation to save memory and speed up inference (Correct answer)
- Freezes model weights permanently
- Disables CUDA operations
Correct answer: Prevents gradient computation to save memory and speed up inference
`torch.no_grad()` disables autograd tracking, reducing memory usage and computation during inference when gradients are not needed.
Question 3: What does the NVIDIA CUDA Unified Memory feature allow developers to do?
- Share CUDA kernels between multiple GPUs
- Access a single memory space accessible by both CPU and GPU without explicit data transfers (Correct answer)
- Combine VRAM from multiple GPUs into one pool
- Automatically optimize memory bandwidth
Correct answer: Access a single memory space accessible by both CPU and GPU without explicit data transfers
Unified Memory creates a managed memory pool accessible by both CPU and GPU, with the CUDA driver handling data migration automatically.
Question 4: Which TensorFlow API is recommended for building models using a layer-by-layer approach with maximum flexibility for custom training loops?
- tf.keras.Sequential
- tf.estimator.Estimator
- tf.keras.Model subclassing (Correct answer)
- tf.compat.v1.Session
Correct answer: tf.keras.Model subclassing
Subclassing `tf.keras.Model` gives maximum flexibility, allowing custom forward passes and fine-grained control over training logic.
Question 5: In the context of NVIDIA GPUs, what is a 'warp' in CUDA terminology?
- A memory transfer operation between CPU and GPU
- A group of 32 threads that execute the same instruction simultaneously (Correct answer)
- A kernel launch configuration parameter
- A type of CUDA stream
Correct answer: A group of 32 threads that execute the same instruction simultaneously
A warp is the fundamental unit of thread scheduling on NVIDIA GPUs, consisting of 32 threads that execute in lockstep (SIMT execution).
Question 6: What is the primary role of NVIDIA NCCL in distributed deep learning?
- Compiling CUDA kernels for multiple GPU architectures
- Providing optimized collective communication primitives for multi-GPU and multi-node training (Correct answer)
- Managing GPU memory allocation across nodes
- Scheduling GPU tasks across a cluster
Correct answer: Providing optimized collective communication primitives for multi-GPU and multi-node training
NCCL (NVIDIA Collective Communications Library) provides optimized all-reduce, broadcast, and other collective operations essential for distributed training.
Question 7: Which data type does TensorFloat-32 (TF32) use, and on which NVIDIA GPU generation was it introduced?
- 16-bit mantissa with 8-bit exponent, introduced on Turing GPUs
- 10-bit mantissa with 8-bit exponent, introduced on Ampere GPUs (Correct answer)
- 23-bit mantissa with 5-bit exponent, introduced on Volta GPUs
- 10-bit mantissa with 5-bit exponent, introduced on Pascal GPUs
Correct answer: 10-bit mantissa with 8-bit exponent, introduced on Ampere GPUs
TF32 uses a 10-bit mantissa and 8-bit exponent (19 bits total) and was introduced on NVIDIA Ampere architecture GPUs to accelerate deep learning.
Which NVIDIA library provides GPU-accelerated primitives specifically optimized for deep neural network operations like convolutions and RNNs?