Skip to content

Commit cc1d251

Browse files
desh2608danpovey
authored andcommitted
Merge master into kaldi10 (#3105)
* [src] Change warp-synchronous to cub::BlockReduce (safer but slower) (#3080) * [src] Fix && and || uses where & and | intended, and other weird errors (#3087) * [build] Some fixes to Makefiles (#3088) clang is unhappy with '-rdynamic' in compile-only step, and the switch is really unnecessary. Also, the default location for MKL 64-bit libraries is intel64/. The em64t/ was explained already obsolete by an Intel rep in 2010: https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/285973 * [src] Fixed -Wreordered warnings in feat (#3090) * [egs] Replace bc with perl -e (#3093) * [scripts] Fix python3 compatibility issue in data-perturbing script (#3084) * [doc] fix some typos in doc. (#3097) * [build] Make sure expf() speed probe times sensibly (#3089) * [scripts] Make sure merge_targets.py works in python3 (#3094) * [src] ifdef to fix compilation failure on CUDA 8 and earlier (#3103) * [doc] fix typos and broken links in doc. (#3102) * [scripts] Fix frame_shift bug in egs/swbd/s5c/local/score_sclite_conf.sh (#3104)
1 parent f5f02d1 commit cc1d251

40 files changed

+175
-244
lines changed

egs/callhome_diarization/v1/diarization/nnet3/xvector/extract_xvectors.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ if [ $stage -le 0 ]; then
102102
fi
103103
utils/data/get_uniform_subsegments.py \
104104
--max-segment-duration=$window \
105-
--overlap-duration=$(echo "$window-$period" | bc) \
105+
--overlap-duration=$(perl -e "print ($window-$period);") \
106106
--max-remaining-duration=$min_segment \
107107
--constant-duration=True \
108108
$segments > $dir/subsegments

egs/callhome_diarization/v1/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ if [ $stage -le 6 ]; then
188188

189189
der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
190190
exp/tuning/${dataset}_t${threshold})
191-
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
191+
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
192192
best_der=$der
193193
best_threshold=$threshold
194194
fi

egs/callhome_diarization/v2/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ if [ $stage -le 10 ]; then
297297

298298
der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
299299
$nnet_dir/tuning/${dataset}_t${threshold})
300-
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
300+
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
301301
best_der=$der
302302
best_threshold=$threshold
303303
fi

egs/dihard_2018/v1/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ if [ $stage -le 7 ]; then
186186

187187
der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
188188
$ivec_dir/tuning/dihard_2018_dev_t${threshold})
189-
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
189+
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
190190
best_der=$der
191191
best_threshold=$threshold
192192
fi

egs/dihard_2018/v2/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ if [ $stage -le 12 ]; then
260260

261261
der=$(grep -oP 'DIARIZATION\ ERROR\ =\ \K[0-9]+([.][0-9]+)?' \
262262
$nnet_dir/tuning/dihard_2018_dev_t${threshold})
263-
if [ $(echo $der'<'$best_der | bc -l) -eq 1 ]; then
263+
if [ $(perl -e "print ($der < $best_der ? 1 : 0);") -eq 1 ]; then
264264
best_der=$der
265265
best_threshold=$threshold
266266
fi

egs/rm/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ About the Resource Management corpus:
99

1010
Each subdirectory of this directory contains the
1111
scripts for a sequence of experiments.
12-
s5 is the currently recommmended setup.
12+
s5 is the currently recommended setup.
1313

1414
s5: This is the "new-new-style" recipe. It is now finished.
1515
All further work will be on top of this style of recipe. Note:

egs/sre08/v1/local/score_sre08.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ tot_eer=0.0
3535
printf '% 12s' 'EER:'
3636
for condition in $(seq 8); do
3737
eer=$(awk '{print $3}' $scores | paste - $trials | awk -v c=$condition '{n=4+c; if ($n == "Y") print $1, $4}' | compute-eer - 2>/dev/null)
38-
tot_eer=$(echo "$tot_eer+$eer" | bc)
38+
tot_eer=$(perl -e "print ($tot_eer+$eer);")
3939
eers[$condition]=$eer
4040
done
4141

42-
eers[0]=$(echo "$tot_eer/8" | bc -l)
42+
eers[0]=$(perl -e "print ($tot_eer/8.0);")
4343

4444
for i in $(seq 0 8); do
4545
printf '% 7.2f' ${eers[$i]}

egs/swbd/s5c/local/score_sclite_conf.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ for f in $data/stm $data/glm $lang/words.txt $lang/phones/word_boundary.int \
3939
[ ! -f $f ] && echo "$0: expecting file $f to exist" && exit 1;
4040
done
4141

42+
if [ -f $dir/../frame_subsampling_factor ]; then
43+
factor=$(cat $dir/../frame_subsampling_factor) || exit 1
44+
frame_shift_opt="--frame-shift=0.0$factor"
45+
echo "$0: $dir/../frame_subsampling_factor exists, using $frame_shift_opt"
46+
fi
47+
4248
name=`basename $data`; # e.g. eval2000
4349

4450
mkdir -p $dir/scoring/log
@@ -51,7 +57,7 @@ if [ $stage -le 0 ]; then
5157
ACWT=\`perl -e \"print 1.0/LMWT\;\"\` '&&' \
5258
lattice-add-penalty --word-ins-penalty=$wip "ark:gunzip -c $dir/lat.*.gz|" ark:- \| \
5359
lattice-align-words $lang/phones/word_boundary.int $model ark:- ark:- \| \
54-
lattice-to-ctm-conf --decode-mbr=$decode_mbr --acoustic-scale=\$ACWT ark:- - \| \
60+
lattice-to-ctm-conf $frame_shift_opt --decode-mbr=$decode_mbr --acoustic-scale=\$ACWT ark:- - \| \
5561
utils/int2sym.pl -f 5 $lang/words.txt \| \
5662
utils/convert_ctm.pl $data/segments $data/reco2file_and_channel \
5763
'>' $dir/score_LMWT_${wip}/$name.ctm || exit 1;

egs/wsj/s5/local/chain/tuning/run_tdnn_1g.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ if [ $stage -le 15 ]; then
160160
echo "$0: creating neural net configs using the xconfig parser";
161161

162162
num_targets=$(tree-info $tree_dir/tree |grep num-pdfs|awk '{print $2}')
163-
learning_rate_factor=$(echo "print 0.5/$xent_regularize" | python)
163+
learning_rate_factor=$(echo "print(0.5/$xent_regularize)" | python)
164164
tdnn_opts="l2-regularize=0.01 dropout-proportion=0.0 dropout-per-dim-continuous=true"
165165
tdnnf_opts="l2-regularize=0.01 dropout-proportion=0.0 bypass-scale=0.66"
166166
linear_opts="l2-regularize=0.01 orthonormal-constraint=-1.0"

egs/wsj/s5/steps/segmentation/internal/merge_targets.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
# Copyright 2017 Vimal Manohar
44
# Apache 2.0
@@ -16,8 +16,6 @@
1616
option.
1717
"""
1818

19-
from __future__ import print_function
20-
from __future__ import division
2119
import argparse
2220
import logging
2321
import numpy as np
@@ -111,7 +109,7 @@ def should_remove_frame(row, dim):
111109
# source[2] = [ 0 0 0 ]
112110
"""
113111
assert len(row) % dim == 0
114-
num_sources = len(row) / dim
112+
num_sources = len(row) // dim
115113

116114
max_idx = np.argmax(row)
117115
max_val = row[max_idx]

egs/wsj/s5/utils/data/perturb_data_dir_volume.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ for line in sys.stdin.readlines():
5252
parts = line.strip().split()
5353
if line.strip()[-1] == '|':
5454
if re.search('sox --vol', ' '.join(parts[-11:])):
55-
print 'true'
55+
print('true')
5656
sys.exit(0)
5757
elif re.search(':[0-9]+$', line.strip()) is not None:
5858
continue
5959
else:
6060
if ' '.join(parts[1:3]) == 'sox --vol':
61-
print 'true'
61+
print('true')
6262
sys.exit(0)
63-
print 'false'
63+
print('false')
6464
"` || exit 1
6565

6666
if $volume_perturb_done; then

src/bin/compute-wer-bootci.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ int main(int argc, char *argv[]) {
162162

163163
try {
164164
const char *usage =
165-
"Compute a bootstrapping of WER to extract the 95\% confidence interval.\n"
165+
"Compute a bootstrapping of WER to extract the 95% confidence interval.\n"
166166
"Take a reference and a transcription file, in integer or text format,\n"
167167
"and outputs overall WER statistics to standard output along with its\n"
168168
"confidence interval using the bootstrap method of Bisani and Ney.\n"
@@ -234,12 +234,12 @@ int main(int argc, char *argv[]) {
234234
std::cout.precision(2);
235235
std::cerr.precision(2);
236236
std::cout << "Set1: %WER " << std::fixed << 100*mean_wer <<
237-
" 95\% Conf Interval [ " << 100*mean_wer-100*interval <<
237+
" 95% Conf Interval [ " << 100*mean_wer-100*interval <<
238238
", " << 100*mean_wer+100*interval << " ]" << '\n';
239239

240240
if(!hyp2_rspecifier.empty()) {
241241
std::cout << "Set2: %WER " << std::fixed << 100*mean_wer2 <<
242-
" 95\% Conf Interval [ " << 100*mean_wer2-100*interval2 <<
242+
" 95% Conf Interval [ " << 100*mean_wer2-100*interval2 <<
243243
", " << 100*mean_wer2+100*interval2 << " ]" << '\n';
244244

245245
std::cout << "Probability of Set2 improving Set1: " << std::fixed <<

src/cudamatrix/cu-device.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,14 @@ void CuDevice::Initialize() {
111111
CUBLAS_SAFE_CALL(cublasCreate(&cublas_handle_));
112112
CUBLAS_SAFE_CALL(cublasSetStream(cublas_handle_, cudaStreamPerThread));
113113

114+
#if CUDA_VERSION >= 9000
114115
if (device_options_.use_tensor_cores) {
115116
// Enable tensor cores in CUBLAS
116117
// Note if the device does not support tensor cores this will fall back to normal math mode
117118
CUBLAS_SAFE_CALL(cublasSetMathMode(cublas_handle_,
118119
CUBLAS_TENSOR_OP_MATH));
119120
}
121+
#endif
120122

121123
// Initialize the cuSPARSE library
122124
CUSPARSE_SAFE_CALL(cusparseCreate(&cusparse_handle_));

0 commit comments

Comments
 (0)