Skip to content
To train deep convolutional neural networks, the input data and the activations need to be kept in memory. Given the limited memory available in current GPUs, this limits the maximum dimensions of the input data. Here we demonstrate a method to train convolutional neural networks while holding only parts of the image in memory.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
SSGD example (with mini-batch).ipynb
SSGD example.ipynb
SSGD same padding.ipynb
poster.pdf
ssgd.py

README.md

StreamingSGD

This repository is an example implementation of Streaming SGD as published here: https://openreview.net/forum?id=HJ7lIcjoM

Abstract To train deep convolutional neural networks, the input data and the intermediate activations need to be kept in memory to calculate the gradient descent step. Given the limited memory available in the current generation accelerator cards, this limits the maximum dimensions of the input data. We demonstrate a method to train convolutional neural networks holding only parts of the image in memory while giving equivalent results.

See notebook for example usage

Requirements

  • PyTorch 0.4
  • tqdm

Model compatibility

  • Layers supported (for now):
    • Conv2d layers (SAME padding now works, example)
    • MaxPool2d layer
    • (all layer types are supported in the non-streaming part of the model)
  • Should work with all:
    • Operations performed on tensors before / after convolutional operations, e.g. non-linear activation functions
    • Loss functions (when using mini-batches: if they are averaged over the instances in the batch)
    • Optimizers
  • Currently under development:
    • Batch normalization alternative

Model requirements

  • model.forward(x, stop_at_layer, start_at_layer): the class will call the forward function of the model with two extra arguments
  • See the notebook for example implementation

Mini-batch support

  • Start a mini-batch by calling .start_batch() en end by calling .end_batch(), all images processed in between those calls are part of the mini-batch.
  • See example notebook
You can’t perform that action at this time.