Question: Alternative to MLeap for Real-Time Inference Without Spark Context with SparkXGBClassifier
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
The issue names no repository files, tests, or entry points to inspect. Begin by reproducing the Spark-based and non-Spark evaluation comparison described, then investigate the serialization and preprocessing boundary. Done would require a documented portable serving approach whose predictions match Spark evaluation without a Spark context.
Written by the indexing model from the issue text.
Description
Question: Alternative to MLeap for Real-Time Inference Without Spark Context
We are exploring alternatives to MLeap for running inference without Spark, since MLeap has limitations with Spark/PySpark version compatibility and library updates.
Our Setup & Goal
- Environment: PySpark 3.5.5
- Algorithm: Distributed ML training using XGBoost with Spark.
- Goal: Run real-time inference without requiring a Spark session/context, to reduce overhead and response latency.
What We Did
- Took a dataset (Titanic), converted it to Parquet, and split it into 80% (train) and 20% (test).
- Trained with Spark (80% data) including preprocessing + XGBoost.
- Evaluated on Spark (20% data) and logged the trained model.
- Tried multiple logging/serialization approaches:
- MLflow
pyfunc - ONNX
- XGBoost native model
- MLflow
- For inference: loaded the same 20% data, applied preprocessing outside Spark, reloaded the trained model, and ran predictions.
The Problem
- In all approaches tested (MLflow
pyfunc, ONNX, XGBoost native save/load), accuracy differs between:- Spark-based evaluation (during training)
- Non-Spark inference (real-time service)
- It seems precision is lost when the model is saved and reloaded outside Spark.
Main Requirement
- The accuracy from Spark-based evaluation and non-Spark inference must match.
- Need a solution to serialize/deserialize models that works across Spark training and non-Spark inference.
- Prefer portable formats (JSON or similar).
- Must avoid Spark context overhead at inference for real-time serving.
Question
👉 Is there any solution or alternative to MLeap for serving models trained with Spark (e.g., XGBoost with PySpark), but performing inference outside of Spark (lightweight, real-time)?
- Should support PySpark 3.5.5
- Must work with XGBoost distributed training
- Should prevent accuracy mismatch between Spark and non-Spark inference
- JSON or portable serialization preferred
Any recommendations for frameworks, libraries, or best practices beyond MLeap would be greatly appreciated.
- Dominant language
- Scala
- Stars
- 1.5k
- Forks
- 313
- Avg merge
- 22m
- Merged PRs (30d)
- 1
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from combust/mleap
-
[Security] Incomplete fix for CVE-2023-5245: zip slip via directory entries in FileUtil.extractOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Similar issues
-
module: backend type: bug/reported
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenXiangShan/XiangShan#6938 ·
Maintainers usually reply within 3 days
-
module: core presentation conversion
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bigbluebutton/bigbluebutton#26508 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day