https://bentoml.com logo
Join Slack
Powered by
# batch-inference
  • t

    Tony Ye

    01/19/2021, 11:14 PM
    Hi @Chaoyu, speaking to @Zikun Xu on the Spark support, he tells me the you guys are not considering Dask instead of Spark and you are working on being able to serialize the BentoService object. Is that correct?
  • c

    Chaoyu

    01/19/2021, 11:19 PM
    @Tony Ye yes that’s correct, we are planning to add APIs to make it easy to create Spark UDFs with BentoML packaged models
  • c

    Chaoyu

    01/19/2021, 11:20 PM
    And we are considering using Dask for BentoML’s own batch inference implementation
  • t

    Tony Ye

    01/19/2021, 11:22 PM
    Where can I find out what exactly is being done for the Spark UDF API? I looked at in over the weekend and the issue I ran into was the fact that BentoService cannot be pickled.
  • c

    Chaoyu

    01/19/2021, 11:22 PM
    BentoML’s own batch inference API is relatively higher-level APIs, where a user will specify where’s the input, where’s the output directory, applying which model. The BentoML to Spark UDF integration gives more flexibility for Spark users who needs to involve a ML model packaged with BentoML.
  • c

    Chaoyu

    01/19/2021, 11:22 PM
    It is still being worked on, BentoService can not be pickled today
  • c

    Chaoyu

    01/19/2021, 11:23 PM
    I’m going to create a github issue for this so you can follow the progress
    👍 1
  • c

    Chaoyu

    01/19/2021, 11:33 PM
    https://github.com/bentoml/BentoML/issues/890
  • t

    Tony Ye

    01/20/2021, 3:10 AM
    I prototyped a possible solution to creating a pandas udf to call the predict API. Obviously calling the load in every call is not the way to go so I am wondering if 1. make model pickle serializable or 2. Caching it so that the load() function call is essentially becomes a very cheap call to make the second time around.
    Copy code
    def load():
        return saved_bundle.load_from_dir(__module_path)
    
    
    def get_pandas_udf():
        from pyspark.sql.functions import pandas_udf
        import pandas as pd
        import pyspark.sql.types as T
    
        def predict(*args):
            X1 = pd.concat(args, axis=1)
            model = load()
            y = pd.Series(model.predict(X1).tolist())
            return y
    
        return pandas_udf(predict, "integer")
  • t

    Tony Ye

    01/20/2021, 3:12 AM
    BTW i added this to INIT_PY_TEMPLATE in saved_bundle/templates.py
  • c

    Chaoyu

    02/09/2021, 9:10 PM
    has renamed the channel from "spark-integration" to "batch-inference"
  • c

    Chaoyu

    02/09/2021, 9:12 PM
    @Jiang @Zikun Xu just renamed the channel to batch-inference, for you guys to post batch inference related plans and progress here.
  • z

    Zikun Xu

    02/09/2021, 9:17 PM
    @Jiang, you could post the latest notebook here, I will try to run it myself, and then sync with you about the implementation plan.
  • j

    Jiang

    02/10/2021, 1:42 AM
    @Zikun Xu got it
  • j

    Jiang

    02/10/2021, 2:21 AM
    dask-k8s.ipynb
  • j

    Jiang

    02/10/2021, 2:30 AM
    @Zikun Xu
  • j

    Jiang

    02/10/2021, 2:31 AM
    This is the k8s version.
  • j

    Jiang

    02/10/2021, 3:37 AM
    In this method, the dask controller is started on the node where the jupyter notebook is located (could be the Host rather than inside of the cluster). And it launches workers in k8s cluster.
  • m

    Mohini Mohan Behera

    10/02/2021, 8:55 PM
    Hello all. Can anyone help me for batch inference in fastai
  • s

    Slackbot

    11/11/2021, 9:02 PM
    This message was deleted.
    c
    s
    j
    • 4
    • 15
  • o

    Olena Vodzianova

    12/06/2021, 2:54 PM
    hi guys, I'd like to integrate bentoml model into pyspark. Do you have any examples?
  • s

    Slackbot

    11/16/2022, 3:57 PM
    This message was deleted.
    s
    m
    • 3
    • 5
  • n

    Nimesh Nethsara

    07/30/2024, 3:21 AM
    👋 Hello, team!