Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_sync_sgd.sh « multi-gpu « training « tests - github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f8698875667598ebe4830a6bedf47e12401895b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash -x

# Exit on error
set -e

if (( $MRT_NUM_DEVICES < 2 )); then
    echo "Too few devices available"
    exit 100
fi

# Test code goes here
rm -rf sync_sgd sync_sgd.log
mkdir -p sync_sgd

$MRT_MARIAN/build/marian \
    --no-shuffle --seed 777 --mini-batch 4 --maxi-batch 1 --maxi-batch-sort none \
    --dim-rnn 64 --dim-emb 32 --learn-rate 0.1 \
    --devices 0 1 --sync-sgd --optimizer sgd \
    -m sync_sgd/model.full.npz -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} -v vocab.en.yml vocab.de.yml \
    --disp-freq 10 --after-batches 100 \
    --log sync_sgd.log

test -e sync_sgd/model.full.npz
test -e sync_sgd.log

cat sync_sgd.log | $MRT_TOOLS/extract-costs.sh > sync_sgd.out
$MRT_TOOLS/diff-floats.py sync_sgd.out sync_sgd.expected -p 0.1 > sync_sgd.diff

# Exit with success code
exit 0