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

github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2018-12-04 00:50:34 +0300
committerRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2018-12-04 00:50:34 +0300
commitedc6a6ddec3deb693fba5909539ac78000c5b8a2 (patch)
tree8e2df3ccc37a3a64b27952f402d8a8342a477a4f /tests/training/multi-gpu
parent9b8749c8d2d2db9ca330d924b5a5d742a85bb652 (diff)
Add test for --sync-sgd --exp-smooth -d 0
Diffstat (limited to 'tests/training/multi-gpu')
-rw-r--r--tests/training/multi-gpu/.gitignore2
-rw-r--r--tests/training/multi-gpu/sync_sgd_1gpu.expected4
-rw-r--r--tests/training/multi-gpu/sync_sgd_1gpu_expsmooth.expected4
-rw-r--r--tests/training/multi-gpu/test_sync_sgd_1gpu.sh25
-rw-r--r--tests/training/multi-gpu/test_sync_sgd_1gpu_expsmooth.sh25
5 files changed, 60 insertions, 0 deletions
diff --git a/tests/training/multi-gpu/.gitignore b/tests/training/multi-gpu/.gitignore
index 00bce2c..090077b 100644
--- a/tests/training/multi-gpu/.gitignore
+++ b/tests/training/multi-gpu/.gitignore
@@ -3,3 +3,5 @@ sync_sgd
sync_expsmooth
+sync_sgd_1gpu
+sync_sgd_1gpu_expsmooth
diff --git a/tests/training/multi-gpu/sync_sgd_1gpu.expected b/tests/training/multi-gpu/sync_sgd_1gpu.expected
new file mode 100644
index 0000000..20a7e2a
--- /dev/null
+++ b/tests/training/multi-gpu/sync_sgd_1gpu.expected
@@ -0,0 +1,4 @@
+236.77311707
+197.57308960
+199.66569519
+184.37145996
diff --git a/tests/training/multi-gpu/sync_sgd_1gpu_expsmooth.expected b/tests/training/multi-gpu/sync_sgd_1gpu_expsmooth.expected
new file mode 100644
index 0000000..20a7e2a
--- /dev/null
+++ b/tests/training/multi-gpu/sync_sgd_1gpu_expsmooth.expected
@@ -0,0 +1,4 @@
+236.77311707
+197.57308960
+199.66569519
+184.37145996
diff --git a/tests/training/multi-gpu/test_sync_sgd_1gpu.sh b/tests/training/multi-gpu/test_sync_sgd_1gpu.sh
new file mode 100644
index 0000000..e3a8255
--- /dev/null
+++ b/tests/training/multi-gpu/test_sync_sgd_1gpu.sh
@@ -0,0 +1,25 @@
+#!/bin/bash -x
+
+# Exit on error
+set -e
+
+# Test code goes here
+rm -rf sync_sgd_1gpu sync_sgd_1gpu.log
+mkdir -p sync_sgd_1gpu
+
+$MRT_MARIAN/marian \
+ --no-shuffle --seed 888 --mini-batch 4 --maxi-batch 1 --maxi-batch-sort none \
+ --dim-rnn 64 --dim-emb 32 --learn-rate 0.1 \
+ --devices 0 --sync-sgd --optimizer sgd \
+ -m sync_sgd_1gpu/model.npz -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} -v vocab.en.yml vocab.de.yml \
+ --disp-freq 5 --save-freq 10 --after-batches 20 \
+ --log sync_sgd_1gpu.log
+
+test -e sync_sgd_1gpu/model.npz
+test -e sync_sgd_1gpu.log
+
+cat sync_sgd_1gpu.log | $MRT_TOOLS/extract-costs.sh > sync_sgd_1gpu.out
+$MRT_TOOLS/diff-nums.py sync_sgd_1gpu.out sync_sgd_1gpu.expected -o sync_sgd_1gpu.diff
+
+# Exit with success code
+exit 0
diff --git a/tests/training/multi-gpu/test_sync_sgd_1gpu_expsmooth.sh b/tests/training/multi-gpu/test_sync_sgd_1gpu_expsmooth.sh
new file mode 100644
index 0000000..510aa26
--- /dev/null
+++ b/tests/training/multi-gpu/test_sync_sgd_1gpu_expsmooth.sh
@@ -0,0 +1,25 @@
+#!/bin/bash -x
+
+# Exit on error
+set -e
+
+# Test code goes here
+rm -rf sync_sgd_1gpu_expsmooth sync_sgd_1gpu_expsmooth.log
+mkdir -p sync_sgd_1gpu_expsmooth
+
+$MRT_MARIAN/marian \
+ --no-shuffle --seed 888 --mini-batch 4 --maxi-batch 1 --maxi-batch-sort none \
+ --dim-rnn 64 --dim-emb 32 --learn-rate 0.1 \
+ --devices 0 --sync-sgd --optimizer sgd --exponential-smoothing \
+ -m sync_sgd_1gpu_expsmooth/model.npz -t $MRT_DATA/europarl.de-en/corpus.bpe.{en,de} -v vocab.en.yml vocab.de.yml \
+ --disp-freq 5 --save-freq 10 --after-batches 20 \
+ --log sync_sgd_1gpu_expsmooth.log
+
+test -e sync_sgd_1gpu_expsmooth/model.npz
+test -e sync_sgd_1gpu_expsmooth.log
+
+cat sync_sgd_1gpu_expsmooth.log | $MRT_TOOLS/extract-costs.sh > sync_sgd_1gpu_expsmooth.out
+$MRT_TOOLS/diff-nums.py sync_sgd_1gpu_expsmooth.out sync_sgd_1gpu_expsmooth.expected -o sync_sgd_1gpu_expsmooth.diff
+
+# Exit with success code
+exit 0