-
Notifications
You must be signed in to change notification settings - Fork 19
/
speed.cpu.intgemm8bitalpha.sh
executable file
·36 lines (25 loc) · 1.45 KB
/
speed.cpu.intgemm8bitalpha.sh
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
#!/bin/bash
MARIAN=../../../marian-dev/build
SRC=es
TRG=en
mkdir -p speed
~/.local/bin/sacrebleu -t wmt13 -l $SRC-$TRG --echo src > speed/newstest2013.$SRC
if [ ! -f model.intgemm.alphas.bin ]; then
test -e model.alphas.npz || $MARIAN/marian-decoder $@ \
--relative-paths -m model.npz -v vocab.esen.spm vocab.esen.spm \
-i speed/newstest2013.$SRC -o speed/cpu.newstest2013.$TRG \
--beam-size 1 --mini-batch 32 --maxi-batch 100 --maxi-batch-sort src -w 128 \
--skip-cost --shortlist lex.s2t.bin false --cpu-threads 1 \
--quiet --quiet-translation --log speed/cpu.newstest2013.log --dump-quantmult 2> quantmults
test -e model.alphas.npz || $MARIAN/../scripts/alphas/extract_stats.py quantmults model.npz model.alphas.npz
test -e model.intgemm.alphas.bin || $MARIAN/marian-conv -f model.alphas.npz -t model.intgemm.alphas.bin --gemm-type intgemm8
fi
echo "### Translating wmt13 $SRC-$TRG on CPU"
$MARIAN/marian-decoder $@ \
--relative-paths -m model.intgemm.alphas.bin -v vocab.esen.spm vocab.esen.spm \
-i speed/newstest2013.$SRC -o speed/cpu.newstest2013.$TRG \
--beam-size 1 --mini-batch 32 --maxi-batch 100 --maxi-batch-sort src -w 128 \
--skip-cost --shortlist lex.s2t.bin false --cpu-threads 1 \
--quiet --quiet-translation --log speed/cpu.newstest2013.log --int8shiftAlphaAll
tail -n1 speed/cpu.newstest2013.log
~/.local/bin/sacrebleu -t wmt13 -l $SRC-$TRG < speed/cpu.newstest2013.$TRG | tee speed/cpu.newstest2013.$TRG.bleu