Skip to content
Open
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
10 changes: 3 additions & 7 deletions src/services/ray/src/ray/deployments/modeling/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(
app: str,
execution_timeout: float | None,
dispatch: bool,
dtype: str | torch.dtype,
dtype: str,
*args,
extra_kwargs: Dict[str, Any] = {},
**kwargs,
Expand All @@ -61,17 +61,13 @@ def __init__(
self.model_key = model_key
self.execution_timeout = execution_timeout
self.dispatch = dispatch
self.dtype = dtype
self.dtype = getattr(torch, dtype)
self.extra_kwargs = extra_kwargs

self.logger = set_logger(app)

self.runtime_context = ray.get_runtime_context()

if isinstance(dtype, str):

dtype = getattr(torch, dtype)

torch.set_default_dtype(torch.bfloat16)

self.model = self.load_from_disk()
Expand Down Expand Up @@ -455,4 +451,4 @@ class BaseModelDeploymentArgs(BaseModel):
execution_timeout: float | None = None
device_map: str | None = "auto"
dispatch: bool = True
dtype: str | torch.dtype = "bfloat16"
dtype: str = "bfloat16"
2 changes: 2 additions & 0 deletions src/services/ray/src/ray/nn/security/protected_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def check(self, name: str) -> bool:
WhitelistedModule(name="collections", strict=False),
WhitelistedModule(name="nnsight.intervention.envoy", strict=False),
WhitelistedModule(name="time", strict=False),
WhitelistedModule(name="hooks.group_offloading", strict=False),
WhitelistedModule(name="", strict=False),


]
Expand Down