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

Add Inference Spec & CI #23

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Add Inference Spec & CI #23

wants to merge 12 commits into from

Conversation

AlejandroEsquivel
Copy link
Contributor

@AlejandroEsquivel AlejandroEsquivel commented Sep 10, 2024

Added:

  • Added Inference Spec class to support Ray, Sagemaker, FastAPI in one go
  • Added CI to support to deploy/update validator's inference endpoint on the cluster

Example Running FastAPI with Inference Spec:

pip install git+https://github.com/guardrails-ai/models-host@feat/adding-ray-setup
uvicorn models_host.fastapi:app

Example Running Ray Serve with Inference Spec:

# Refer to models-host repo for instructions if you don't have a GPU on the machine running ray serve
pip install git+https://github.com/guardrails-ai/models-host@feat/adding-ray-setup
serve run models_host.ray_serve:app

@AlejandroEsquivel AlejandroEsquivel marked this pull request as ready for review September 17, 2024 01:10
@AlejandroEsquivel AlejandroEsquivel changed the title Feat/ray serve Add Inference Spec & CI Sep 17, 2024
@AlejandroEsquivel AlejandroEsquivel marked this pull request as draft September 17, 2024 06:29
@AlejandroEsquivel AlejandroEsquivel marked this pull request as ready for review September 17, 2024 20:55
Comment on lines +42 to +45
def torch_device(self):
env = os.environ.get("env", "dev")
torch_device = "cuda" if env == "prod" else "cpu"
return torch_device
Copy link
Contributor

@JosephCatrambone JosephCatrambone Sep 26, 2024

Choose a reason for hiding this comment

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

If we're bound to this for historical reasons I would let it slide, but I feel like names should be indicative of what they are. Could we call the environment variable 'inference_device' and pass it directly? If I read 'env' for something else dev but want to run on my local GPU I might make a bad mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was left for reverse compatibility but now that we're fully switched over this is a good time to phase it out 👍🏼

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