Skip to content
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
2 changes: 1 addition & 1 deletion prek.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ hooks = [{ id = "uv-lock" }]
[[repos]]
# Keep in sync with the ty pin in pyproject.toml; check-tool-pins enforces it.
repo = "https://github.com/astral-sh/ty-pre-commit"
rev = "v0.0.82"
rev = "v0.0.95"
hooks = [{ id = "ty" }]

[[repos]]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dev = [
"scalene>=1.5",
"prek>=0.2.6",
"ruff==0.17.3",
"ty==0.0.82",
"ty==0.0.95",
{ include-group = "test" },
{ include-group = "bench" },
]
Expand Down
8 changes: 4 additions & 4 deletions src/src_method/utils/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from array_api_compat import numpy as np_compat

if TYPE_CHECKING:
from collections.abc import Iterator, Sequence
from collections.abc import Generator, Sequence
from types import ModuleType

from numpy.typing import DTypeLike
Expand Down Expand Up @@ -193,7 +193,7 @@ def device_count(xp: ModuleType) -> int | None:


@contextmanager
def use_device(xp: ModuleType, device: int) -> Iterator[None]:
def use_device(xp: ModuleType, device: int) -> Generator[None]:
"""Make ``device`` current in the calling thread for the duration of the block.

On the host backend the devices of a group are simulated: they share the host,
Expand All @@ -220,7 +220,7 @@ def use_device(xp: ModuleType, device: int) -> Iterator[None]:


@contextmanager
def use_stream(xp: ModuleType) -> Iterator[None]:
def use_stream(xp: ModuleType) -> Generator[None]:
"""Run the block on a non-blocking stream of the current device.

On the legacy null stream, a peer copy into one device serializes with the copy
Expand Down Expand Up @@ -392,7 +392,7 @@ def release_cached_blocks(xp: ModuleType) -> None:


@contextmanager
def device_pool_limit(xp: ModuleType, budget: int | None) -> Iterator[None]:
def device_pool_limit(xp: ModuleType, budget: int | None) -> Generator[None]:
"""Cap cupy's default memory pool at ``budget`` bytes beyond its current use.

An allocation past the cap fails at once instead of when another allocation
Expand Down
44 changes: 22 additions & 22 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading