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

Use new litserve accelerator="auto" setting #1336

Merged
merged 7 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions litgpt/deploy/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def run_server(
top_k: int = 200,
max_new_tokens: int = 50,
devices: int = 1,
accelerator: str = "cuda",
accelerator: str = "auto",
port: int = 8000
) -> None:
"""Serve a LitGPT model using LitServe
Expand All @@ -114,7 +114,8 @@ def run_server(
generated text but can also lead to more incoherent texts.
max_new_tokens: The number of generation steps to take.
devices: How many devices/GPUs to use.
accelerator: The type of accelerator to use. For example, "cuda" or "cpu".
accelerator: The type of accelerator to use. For example, "auto", "cuda", "cpu", or "mps".capitalize
rasbt marked this conversation as resolved.
Show resolved Hide resolved
The "auto" setting (default) chooses a GPU if available, and otherwise uses a CPU.
port: The network port number on which the model is configured to be served.
"""
check_valid_checkpoint_dir(checkpoint_dir, model_filename="lit_model.pth")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies = [
"torch>=2.2.0",
"lightning==2.3.0.dev20240328",
"jsonargparse[signatures]>=4.27.6",
"litserve==0.0.0.dev2", # imported by litgpt.deploy
"litserve @ git+https://github.com/Lightning-AI/litserve.git@aefcb13721b97b9da4ed9f7166b2f870bedfd92f", # imported by litgpt.deploy
rasbt marked this conversation as resolved.
Show resolved Hide resolved
]

[project.urls]
Expand Down
Loading