You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/09/08 14:42:23 UTC

[PR] [SPARK-59340][ML] Reduce Word2VecModel broadcast size [spark]

zhengruifeng opened a new pull request, #58627:
URL: https://github.com/apache/spark/pull/58627

   ### What changes were proposed in this pull request?
   
   Broadcast only the word-index map and flattened word-vector array used by
   `Word2VecModel.transform`, instead of broadcasting the legacy MLlib `Word2VecModel` instance.
   
   ### Why are the changes needed?
   
   The legacy model also contains derived fields used by synonym lookup, including lazy caches that
   may already have been initialized. These fields are not needed when transforming sentences, but
   they become part of the broadcast when the whole model is serialized. Broadcasting the two lookup
   structures directly keeps the payload limited to the state used by the transform UDF.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Ran:
   
   ```
   JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 build/sbt \
     'mllib/testOnly org.apache.spark.ml.feature.Word2VecSuite'
   ```
   
   All 10 tests passed.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: OpenAI Codex (GPT-5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59340][ML] Reduce Word2VecModel broadcast size [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #58627: [SPARK-59340][ML] Reduce Word2VecModel broadcast size
URL: https://github.com/apache/spark/pull/58627


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59340][ML] Reduce Word2VecModel broadcast size [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #58627:
URL: https://github.com/apache/spark/pull/58627#issuecomment-5590270434

   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-59340][ML] Reduce Word2VecModel broadcast size [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #58627:
URL: https://github.com/apache/spark/pull/58627#issuecomment-5594549098

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/e7f758270c85d6a0015ce65bca471a9806157bdb
   - merged into branch-4.x https://github.com/apache/spark/commit/dbe14d653b4625f240f6fc5e5527c7ce2dd06bf0
   
   *Posted by `merge_spark_pr.py`*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org