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

[maca] add cudagraph support on maca backend. #2834

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions lmdeploy/pytorch/backends/dlinfer/maca/op_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import torch

from lmdeploy.pytorch.config import BackendConfig, CacheConfig, ModelConfig
from lmdeploy.utils import get_logger

from ..op_backend import DlinferOpsBackend
Expand Down Expand Up @@ -101,3 +102,10 @@ def get_total_slots():

step_context.attn_metadata = attn_metadata
return step_context

@staticmethod
def build_graph_runner(model: torch.nn.Module, model_config: ModelConfig, cache_config: CacheConfig,
backend_config: BackendConfig, device: torch.device):
"""build graph runner."""
from lmdeploy.pytorch.backends.cuda.graph_runner import CUDAGraphRunner
return CUDAGraphRunner(model, model_config, cache_config, backend_config, device)
2 changes: 1 addition & 1 deletion lmdeploy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def get_max_batch_size(device_type: str):
elif device_type == 'ascend':
return 16
elif device_type == 'maca':
return 128
return 256
elif device_type == 'camb':
return 128

Expand Down