Revision 11ee9d191e26a41a44ff0ca8730a129934942ee7 authored by Yuhao Yang on 18 November 2015, 21:25:15 UTC, committed by Xiangrui Meng on 18 November 2015, 21:26:39 UTC
jira: https://issues.apache.org/jira/browse/SPARK-11813 I found the problem during training a large corpus. Avoid serialization of vocab in Word2Vec has 2 benefits. 1. Performance improvement for less serialization. 2. Increase the capacity of Word2Vec a lot. Currently in the fit of word2vec, the closure mainly includes serialization of Word2Vec and 2 global table. the main part of Word2vec is the vocab of size: vocab * 40 * 2 * 4 = 320 vocab 2 global table: vocab * vectorSize * 8. If vectorSize = 20, that's 160 vocab. Their sum cannot exceed Int.max due to the restriction of ByteArrayOutputStream. In any case, avoiding serialization of vocab helps decrease the size of the closure serialization, especially when vectorSize is small, thus to allow larger vocabulary. Actually there's another possible fix, make local copy of fields to avoid including Word2Vec in the closure. Let me know if that's preferred. Author: Yuhao Yang <hhbyyh@gmail.com> Closes #9803 from hhbyyh/w2vVocab. (cherry picked from commit e391abdf2cb6098a35347bd123b815ee9ac5b689) Signed-off-by: Xiangrui Meng <meng@databricks.com>
1 parent 19835ec
File | Mode | Size |
---|---|---|
beeline | -rwxr-xr-x | 1.0 KB |
compute-classpath.cmd | -rw-r--r-- | 5.2 KB |
compute-classpath.sh | -rwxr-xr-x | 6.0 KB |
load-spark-env.sh | -rw-r--r-- | 1.4 KB |
pyspark | -rwxr-xr-x | 3.6 KB |
pyspark.cmd | -rw-r--r-- | 1000 bytes |
pyspark2.cmd | -rw-r--r-- | 2.3 KB |
run-example | -rwxr-xr-x | 2.2 KB |
run-example.cmd | -rw-r--r-- | 1012 bytes |
run-example2.cmd | -rw-r--r-- | 2.7 KB |
spark-class | -rwxr-xr-x | 6.3 KB |
spark-class.cmd | -rw-r--r-- | 1010 bytes |
spark-class2.cmd | -rw-r--r-- | 5.9 KB |
spark-shell | -rwxr-xr-x | 3.2 KB |
spark-shell.cmd | -rwxr-xr-x | 949 bytes |
spark-sql | -rwxr-xr-x | 1.9 KB |
spark-submit | -rwxr-xr-x | 2.4 KB |
spark-submit.cmd | -rw-r--r-- | 2.5 KB |
utils.sh | -rwxr-xr-x | 2.0 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...