#
# Sample test config file. Test config files are sourced by the control script,
# and all variables named rn50_* are processed for testing. Each such set of
# of tests begins with configuration assignments (node, gpupernode, [fillorder])
# followed by dataloader test cases to run for that configuration.
#
# Columns for each test set are:
#
# model             training|inference|both|- (- to disable)
# data-backend      will be used as the --data-backend argument in main.py
# context           if context is say xyz then will expand to value of ${config_xyz}, interpreted per dataloader type
#                       webdataset: AIS gateway
# datapath          the final argument to main.py - the dataset filesystem path or bucket name
# batchsize         the batch size to use on the main.py cmdline
# cast              fp16, amp or none for --fp16, --amp or no model cast
# epochs            number of epochs to time for
# iterations        maximum number of iterations per epochs
# extra             extra for backend; for webdataset this is bucket name
#
# Note: the quotes are essential!
#

declare -a enabled_sets=(
    "rn50_red"
    "rn50_pink"
    "rn50_bluelite"
    "rn50_green"
    "rn50_yellow"
)

rn50_red="$(cat <<-EOM
    config_worlds=1x1,1x2,1x4,1x8
    config_fillorder=widthfirst
    config_ais12=http://demo-ais-proxy:51080
    config_ais1=http://10.132.181.10:51080
    config_shardpat_std=\"imagenet_train-{0000..0147}.tar\"
    config_shardpat_inflated_std=\"imagenet_train-{0000..9999}.tar\"
    config_shardpat_augmented=\"imagenet_train-{0000..0147}-{000..019}.tar\"
    config_shardpat_inflated_augmented=\"imagenet_train-{0000..9999}-{000..019}.tar\"
    both    pytorch         -       /data/imagenet          256     fp16    1       100     -
    both    dali-cpu        -       /data/imagenet          256     fp16    1       100     -
    both    dali-gpu        -       /data/imagenet          256     fp16    1       100     -
EOM
)"

rn50_pink="$(cat <<-EOM
    config_worlds=1x1,1x2,1x4,1x8
    config_fillorder=widthfirst
    config_ais12=http://demo-ais-proxy:51080
    config_ais1=http://10.132.181.10:51080
    config_shardpat_std=\"imagenet_train-{0000..0147}.tar\"
    config_shardpat_inflated_std=\"imagenet_train-{0000..9999}.tar\"
    config_shardpat_augmented=\"imagenet_train-{0000..0147}-{000..019}.tar\"
    config_shardpat_inflated_augmented=\"imagenet_train-{0000..9999}-{000..019}.tar\"
    both    pytorch         -       /data/imagenet-inflated          256     fp16    1       100     -
    both    dali-cpu        -       /data/imagenet-inflated          256     fp16    1       100     -
    both    dali-gpu        -       /data/imagenet-inflated          256     fp16    1       100     -
EOM
)"

rn50_bluelite="$(cat <<-EOM
    config_worlds=1x1,1x2,1x4,1x8,2x8,4x8,8x8
    config_fillorder=widthfirst
    config_ais12=http://demo-ais-proxy:51080
    config_ais1=http://10.132.181.10:51080
    config_shardpat_std=\"imagenet_train-{0000..0147}.tar\"
    config_shardpat_inflated_std=\"imagenet_train-{0000..9999}.tar\"
    config_shardpat_augmented=\"imagenet_train-{0000..0147}-{000..019}.tar\"
    config_shardpat_inflated_augmented=\"imagenet_train-{0000..9999}-{000..019}.tar\"
    both    pytorch         -       /nfs/imagenet          256     fp16    1       100     -
EOM
)"

rn50_green="$(cat <<-EOM
    config_worlds=1x1,1x2,1x4,1x8,2x8,4x8,8x8
    config_fillorder=widthfirst
    config_ais12=http://demo-ais-proxy:51080
    config_ais1=http://10.132.181.10:51080
    config_shardpat_std=\"imagenet_train-{0000..0147}.tar\"
    config_shardpat_inflated_std=\"imagenet_train-{0000..9999}.tar\"
    config_shardpat_augmented=\"imagenet_train-{0000..0147}-{000..019}.tar\"
    config_shardpat_inflated_augmented=\"imagenet_train-{0000..9999}-{000..019}.tar\"
    both    webdataset      ais1    lpr-imagenet-uncompressed 256   fp16    1       100     shardpat_std
EOM
)"

rn50_yellow="$(cat <<-EOM
    config_worlds=1x1,1x2,1x4,1x8,2x8,4x8,8x8
    config_fillorder=widthfirst
    config_ais12=http://demo-ais-proxy:51080
    config_ais1=http://10.132.181.10:51080
    config_shardpat_std=\"imagenet_train-{0000..0147}.tar\"
    config_shardpat_inflated_std=\"imagenet_train-{0000..9999}.tar\"
    config_shardpat_augmented=\"imagenet_train-{0000..0147}-{000..019}.tar\"
    config_shardpat_inflated_augmented=\"imagenet_train-{0000..9999}-{000..019}.tar\"
    both    webdataset      ais12    lpr-imagenet-inflated 256   fp16    1       100     shardpat_inflated_std
EOM
)"

rn50_testset1="$(cat <<-EOM
    config_nodes=1,2,4,8
    config_gpupernode=1,8
    config_fillorder=widthfirst
    config_ais12=http://demo-ais-proxy:51080
    config_ais1=http://10.132.181.10:51080
    config_shardpat_std=\"imagenet_train-{0000..0147}.tar\"
    config_shardpat_inflated_std=\"imagenet_train-{0000..9999}.tar\"
    config_shardpat_augmented=\"imagenet_train-{0000..0147}-{000..019}.tar\"
    config_shardpat_inflated_augmented=\"imagenet_train-{0000..9999}-{000..019}.tar\"
    -       dali-cpu        -       /data/imagenet          64      fp16    1       100     -
    -       dali-gpu        -       /data/imagenet          64      fp16    1       100     -
    -       dali-cpu        -       /nfs/imagenet           64      fp16    1       100     -
    -       dali-gpu        -       /nfs/imagenet           64      fp16    1       100     -
    -       pytorch         -       /nfs/imagenet-inflated  256     fp16    1       100     -
    both    pytorch         -       /nfs/imagenet           256     fp16    1       100     -
    both    pytorch         -       /data/imagenet          256     fp16    1       100     -
    both    pytorch         -       /data/imagenet-inflated 256     fp16    1       100     -
    both    webdataset-pre  ais12   lpr-imagenet-augmented-uncompressed 256 fp16 1  100     shardpat_augmented
    both    webdataset      ais12   lpr-imagenet-uncompressed 256   fp16    1       100     shardpat_std
    both    webdataset-pre  ais12   lpr-imagenet-augmented-replicated 256 fp16 1    100     shardpat_inflated_augmented
    both    webdataset      ais1    lpr-imagenet-uncompressed 256   fp16    1       100     shardpat_std
    both    webdataset-pre  ais1    lpr-imagenet-augmented-uncompressed 256 fp16 1  100     shardpat_augmented
    both    webdataset-pre  ais1    lpr-imagenet-augmented-replicated 256 fp16 1    100     shardpat_inflated_augmented
    -       dali-cpu        -       /nfs/imagenet-inflated  64      fp16    1       100     -
    -       dali-gpu        -       /nfs/imagenet-inflated  64      fp16    1       100     -
EOM
)"