Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default truss. #565

Merged
merged 6 commits into from
Aug 15, 2023
Merged

Change default truss. #565

merged 6 commits into from
Aug 15, 2023

Conversation

squidarth
Copy link
Collaborator

Summary

Made the following changes

  1. Changed the default model.py file to be more informative
  2. Changed the resource units

@philipkiely-baseten Getting rid of the external_packages is a little bit more of an involved change (requires a baseten deploy), so we can work towards that, but won't do that here.

@@ -29,8 +29,8 @@
DEFAULT_SPEC_VERSION = "2.0"
DEFAULT_PREDICT_CONCURRENCY = 1

DEFAULT_CPU = "500m"
DEFAULT_MEMORY = "512Mi"
DEFAULT_CPU = "1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing these default will map to something that's not the supported lowest instance type (which is 1cpu, 2Gi memory minus daemonsets, which will need some buffer.

I think 750m, 1.5Gi should be safe but up to you.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha. We wanted to make that change because the default values weren't super intuitive (500m? 512Mi?) but we weren't sure if Baseten required the buffer.

We should work on a way to make specifying resources more intuitive but it doesn't have to block this release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing these default will map to something that's not the supported lowest instance type (which is 1cpu, 2Gi memory minus daemonsets, which will need some buffer.

I tried deploying this and it did deploy on the 1x2 instance

@@ -1,19 +1,30 @@
from typing import Any
"""
This file is where the key logic for serving your model is defined.
Copy link
Member

@philipkiely-baseten philipkiely-baseten Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good help message, I'm just going to update it quick before merge with copy and links that match the docs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool -- go for it!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The `Model` class is an interface between the ML model that you're packaging and the model server that you're running it on.

The main methods to implement here are:
* `load`: runs exactly once when the model server is spun up or patched and loads the model onto the model server. Include any logic for initializing your model, such as downloading model weights and loading the model into memory.
* `predict`: runs every time the model server is called. Include any logic for model inference and return the model output.

See https://truss.baseten.co/quickstart for more.

self._model = None

def load(self):
# Load model here and assign to self._model.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually like the assign to self._model help text here

@squidarth squidarth merged commit 8fa29ce into main Aug 15, 2023
@squidarth squidarth deleted the sshanker/change-default-truss branch August 15, 2023 17:00
@squidarth squidarth mentioned this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants