Figure out better way of caching MOJO Pipelines in H2OMOJOPipelineModel transformer

Description

Problem

The code:
https://github.com/h2oai/sparkling-water/blob/ea5b11a4c77a20211ee04dde3c6941026042dd61/scoring/src/main/scala/ai/h2o/sparkling/ml/models/H2OMOJOPipelineModel.scala#L36-L39
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

Environment

None

Status

Assignee

Jakub Hava

Reporter

Michal Malohlava

Labels

None

Release Priority

None

CustomerVisible

No

testcase 1

None

testcase 2

None

testcase 3

None

h2ostream link

None

Affected Spark version

None

AffectedContact

None

AffectedCustomers

None

AffectedPilots

None

AffectedOpenSource

None

Support Assessment

None

Customer Request Type

None

Support ticket URL

None

End date

None

Baseline start date

None

Baseline end date

None

Task progress

None

Task mode

None

Fix versions

Priority

Major
Configure