• Vasiliy Kuznetsov's avatar
    torchvision QAT tutorial: update for QAT with DDP (#2280) · 39021408
    Vasiliy Kuznetsov authored
    Summary:
    
    We've made two recent changes to QAT in PyTorch core:
    1. add support for SyncBatchNorm
    2. make eager mode QAT prepare scripts respect device affinity
    
    This PR updates the torchvision QAT reference script to take
    advantage of both of these.  This should be landed after
    https://github.com/pytorch/pytorch/pull/39337 (the last PT
    fix) to avoid compatibility issues.
    
    Test Plan:
    
    ```
    python -m torch.distributed.launch
      --nproc_per_node 8
      --use_env
      references/classification/train_quantization.py
      --data-path {imagenet1k_subset}
      --output-dir {tmp}
      --sync-bn
    ```
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    39021408
train_quantization.py 10.6 KB