apiVersion: graphcore.ai/v1alpha1
kind: IPUJob
metadata:
  name: mnist-distributed-training
spec:
  jobInstances: 1
  ipusPerJobInstance: "2"
  workersPerJobInstance: "2"
  modelReplicasPerWorker: "1"
  launcher:
    command:
      - mpirun
      - --allow-run-as-root
      - --bind-to
      - none
      - -np
      - "2"
      - bash
      - -c
      - cd /opt/tutorials/simple_applications/pytorch/mnist; pip3 install -r requirements.txt && sed -i 's/poptorch.Options()/poptorch.Options\(\).randomSeed\(0\)/g' mnist_poptorch.py && python3 mnist_poptorch.py --epochs=1
  workers:
    template:
      spec:
        containers:
        - name: mnist-distributed-training
          image: graphcore/pytorch-tutorials:3.0.0
