引導式測驗 · 硬 等級

Hugging Face 多 GPU 訓練加速測驗

使用 Accelerate 跨裝置移動 PyTorch 腳本,同時檢查資料分片、指標縮減、混合精確度和檢查點安全性。

相關引導路徑Hugging Face 加速多 GPU
問題 1 的 8

What does Accelerate primarily help a PyTorch training script do?

預覽每個問題8 問題

當您參加測驗時,就會出現答案和解釋。

  1. What does Accelerate primarily help a PyTorch training script do?
    • Defines the model architecture for the task
    • Selects an objective function from the labels
    • Run across supported hardware and distributed configurations with shared code
    • Generates evaluation data from training examples
  2. Why pass common training objects through Accelerator preparation?
    • Automatically tunes the optimizer learning rate
    • To prepare them for the configured device and strategy
    • Selects a checkpoint from validation metrics
    • Rewrites the model training objective
  3. What can happen if workers do not participate consistently in distributed collectives?
    • The loss becomes a calibrated probability
    • The process always exits cleanly after one rank stops
    • Distributed communication no longer occurs
    • The run can hang while processes wait for one another
  4. Why may local evaluation metrics need reduction across processes?
    • Each process may see only part of the evaluation data
    • Every process automatically has a globally reduced metric
    • Metric values are stored directly in model weights
    • Reduction converts labels to distributed indices
  5. What should be verified about batch size when moving from one GPU to several?
    • Assume it stays equal to the single-GPU batch in every setup
    • Determine whether the configured size is per process or global
    • Assume prepare always makes batch size equal to label count
    • Treat batch size as the number of GPUs
  6. Why guard shared checkpoint writes in a multi-process job?
    • Prevent workers from training at the same time
    • Avoid concurrent workers racing to write the same shared path
    • Ensure every rank reads different labels
    • Synchronize gradients before a checkpoint is written
  7. Does using multiple GPUs guarantee proportional speedup?
    • Speedup must equal the number of GPUs if the script is unchanged
    • The model size is the only factor that determines scaling
    • Data movement and synchronization can limit measured speedup
    • Parallel training cannot run on multiple devices
  8. Which verification checks a saved multi-device artifact for practical reuse?
    • Load it in the intended inference environment
    • Keep it accessible only inside the worker process
    • Assume it includes the full dataset
    • Skip validation because the job completed