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

test_student_small_aan_intgemm16.sh « wnmt18 « models « tests - github.com/marian-nmt/marian-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ad88e9caa67fc55ffc85bdd912c1287e2c596b27 (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
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash

#####################################################################
# SUMMARY: CPU-based optimized decoding with the WNGT18 small student model with AAN and intgemm 16bit
# TAGS: cpu wngt student shortlist intgemm
#####################################################################

# Exit on error
set -e

# Skip if no CPU found
if [ ! $MRT_MARIAN_USE_CPU ]; then
    exit 100
fi

model=model.student.small.aan

# Remove previous outputs
rm -f optimize_aan_16.out $model.intgemm16.bin

# Pack the model
$MRT_MARIAN/marian-conv -f $MRT_MODELS/wnmt18/$model/model.npz -t $model.intgemm16.bin --gemm-type intgemm16
test -s $model.intgemm16.bin

# Run test
cat newstest2014.in | $MRT_MARIAN/marian-decoder \
    -m $model.intgemm16.bin \
    -v $MRT_MODELS/wnmt18/vocab.ende.{yml,yml} \
    --mini-batch-words 384 --mini-batch 100 --maxi-batch 100 --maxi-batch-sort src -b1 \
    --shortlist $MRT_MODELS/wnmt18/lex.s2t 100 75 --skip-cost --cpu-threads=1 --max-length-factor 1.2 \
    > optimize_aan_16.out

cat optimize_aan_16.out | perl -pe 's/@@ //g' \
    | $MRT_TOOLS/moses-scripts/scripts/recaser/detruecase.perl \
    | $MRT_TOOLS/moses-scripts/scripts/generic/multi-bleu.perl newstest2014.ref \
    | $MRT_TOOLS/extract-bleu.sh > optimize_aan_16.bleu

$MRT_TOOLS/diff-nums.py optimize_aan_16.bleu optimize_aan.bleu.expected -p 0.6 -o optimize_aan_16.bleu.diff

# Exit with success code
exit 0