You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
loads MOJO pipeline from actual bytes, however, it will happen for each thread running in executor (i.e., thread representing executor core). This brings significant memory, time overhead for bigger MOJO models.
Goal
Load the MOJO model only once per JVM and share it cross multiple executor threads.
If we decide to cache MOJO, we have to make sure we will not leave it in memory for too long,
and also expect that Spark job can use multiple MOJOs
The text was updated successfully, but these errors were encountered:
Michal Malohlava commented: Should we broadcast the model? (similar to idea sketch here: [https://stackoverflow.com/questions/40435741/object-cache-on-spark-executors|https://stackoverflow.com/questions/40435741/object-cache-on-spark-executors])
Jakub Hava commented: We already broadcast the mojo bytes → spark driver registers it as the broadcast variable and executors just fetch it when they need it.
We could also try create instance of the MOJO model on driver and broadcast it, but not sure if we hit any serialization issues. But that would be definitely good improvement. I can have a look on it today and at least check if the model be serialized or not
Problem
The code:
sparkling-water/scoring/src/main/scala/ai/h2o/sparkling/ml/models/H2OMOJOPipelineModel.scala
Lines 36 to 39 in ea5b11a
loads MOJO pipeline from actual bytes, however, it will happen for each thread running in executor (i.e., thread representing executor core). This brings significant memory, time overhead for bigger MOJO models.
Goal
Load the MOJO model only once per JVM and share it cross multiple executor threads.
The text was updated successfully, but these errors were encountered: