Flexible Model Deployment

Fiddler supports explainability for models with varying dependencies. This is achieved by running each model in its own pod to provide the resources and dependencies that are unique to that model. For example, if your team has two models developed with the same libraries but using different versions you can run both those models by specifying the exact version they were built with.

📘 Note

Follow this page if you want to upload a model artifact or a surrogate model. For monitoring only models, without artifact uploaded, this is not required.

When you add a model artifact into Fiddler (see add_artifact), you can specify the deployment needed to run the model.

add_model_artifact now takes a deployment_params argument where you can specify the following information using DeploymentParams:

  • image_uri: This is the docker image used to create a new runtime to serve the model. You can choose a base image from the following list, with the matching requirements for your model:

📘 Images upgrade

Images are upgraded constantly in order to resolve packages vulnerabilities. The tag is updated accordingly. Unsupported Python versions are not provided.

🚧 Be aware

Model version features are supported with the image versions listed above. Images below 2.x for python-39, java and rpy2 will continue to work for existing models with single version. From 24.5 onwards, model version first class support is added and these required the new model deployment base image tag versions.

Each base image comes with a few pre-installed libraries and these can be overridden by specifying requirements.txt file inside your model artifact directory where package.py is defined.

Note that the old images deep-learning and machine-learning are deprecated (All current versions are still working, but we stopped maintaining and upgrading those). We encourage users to use any plain python image and add teh necessary libraries in requirements.txt.

🚧 Be aware

Installing new dependencies at runtime will take time and is prone to network errors.

  • replicas: The number of replicas running the model.

  • memory: The amount of memory (mebibytes) reserved per replica. NLP models might need more memory, so ensure to allocate the required amount of resources.

🚧 Be aware

Your model might need more memory than the default setting. Please ensure you set appropriate amount of resources. If you get a ModelServeError error when adding a model, it means you didn't provide enough memory for your model.

  • cpu: The amount of CPU (milli cpus) reserved per replica.

Both add_artifact and update_artifact methods support passing deployment_params. For example:

# Specify deployment parameters
deployment_params = fdl.DeploymentParams(
        image_uri="md-base/python/python-311:1.0.0",
        cpu=250,
        memory=512,
          replicas=1)

# Add model artifact
job = model.add_artifact(
  model_dir =  str, #path to your model dirctory with model artifacts and package.py
  deployment_param = DeploymentParams | None,
) -> AsyncJob
job.wait()

Once the model is added in Fiddler, you can fine-tune the model deployment based on the scaling requirements, using update_model_deployment. This function allows you to:

  • Horizontal scaling: horizontal scaling via replicas parameter. This will create multiple Kubernetes pods internally to handle requests.

  • Vertical scaling: Model deployments support vertical scaling via cpu and memory parameters. Some models might need more memory to load the artifacts into memory or process the requests.

  • Scale down: You may want to scale down the model deployments to avoid allocating the resources when the model is not in use. Use active parameters to scale down the deployment.

  • Scale up: This will again create the model deployment Kubernetes pods with the resource values available in the database.

Last updated

© 2024 Fiddler AI