Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xvector extractor cache config #2290

Merged
merged 2 commits into from
Mar 22, 2018
Merged

Conversation

gorinars
Copy link
Contributor

Following the discussion in
https://groups.google.com/forum/#!topic/kaldi-help/ROtSHHe3Z_I

Using larger cache speeds up extraction if equal length segments have already been processed

@gorinars
Copy link
Contributor Author

Travis build failed with a strange error

./matrix/libkaldi-matrix.so: file not recognized: File truncated

I feel like, if possible, just re-running it would solve the issue. If I should re-create this PR to trigger travis, please let me know

@jtrmal
Copy link
Contributor

jtrmal commented Mar 22, 2018 via email

@danpovey
Copy link
Contributor

the build isn't necessary when code is not changed. it's a travis issue. I'll merge.

@danpovey
Copy link
Contributor

I see that the default in the code is 64. Perhaps it would make sense to use a larger value as the default in the script, assuming this makes the code run faster?

@gorinars
Copy link
Contributor Author

64 is the setting we use now by default.
I usually use 475 for chunk-size=500 to make sure computer is compiled only once for a given segment size. For SRE the right value would be 10000, but I'm not sure about the memory consumption then.

@danpovey
Copy link
Contributor

danpovey commented Mar 22, 2018 via email

@david-ryan-snyder
Copy link
Contributor

@danpovey, those issues are both important but actually orthogonal. @LvHang PR speeds up training. @gorinars PR only affects the x-vector system after it's been trained. To answer your question... I still haven't made progress on it, but I haven't forgotten about it either.

BTW, @gorinars, feel free to add your name to the author list on those files, so that your contribution is more visibly credited.

@david-ryan-snyder
Copy link
Contributor

david-ryan-snyder commented Mar 22, 2018

It occurred to me I might've misunderstood what you meant, @danpovey.

If you're talking about reducing the number of segment-lengths during x-vector extracting, I think the issue is basically solved already (especially given @gorinars PR).

In diarization, we already extract embeddings from fixed-length chunks (e.g., 150 length chunks). For speaker recognition, we usually set a (near) infinite right context, because we found that it's empirically better to extract embeddings from the entire recording. However, if speed is an issue (I think the standard recipe is pretty fast anyway), the user can set chunk-length=1000 or something like that, and the binary will extract embeddings from 1000 frame chunks, and average them to produce the final embedding.

@gorinars
Copy link
Contributor Author

gorinars commented Mar 22, 2018

@david-ryan-snyder that exactly what led to the PR issue.
I was setting chunk-length=1000, but the actual chunks are sometimes smaller, like 900, 101, etc if the segment is shorter than chunk-size. Re-compilation for each of them was slowing down the system significantly.
So we finally ended up with stuff implemented in nnet3-xvector-compute-parallel.cc in #2303 by passing the pre-compiled cache for all segment lengths and increasing the cache size.

@gorinars
Copy link
Contributor Author

@david-ryan-snyder thanks for remark about adding the name. Not sure for this particular change - it is really a very small modification.

@danpovey
Copy link
Contributor

I'll merge, it won't break anything.

@danpovey danpovey merged commit 9ae3eb7 into kaldi-asr:master Mar 22, 2018
LvHang pushed a commit to LvHang/kaldi that referenced this pull request Apr 14, 2018
…ldi-asr#2290)

Conflicts:
	egs/sre08/v1/sid/nnet3/xvector/extract_xvectors.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants