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
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ jobs:
- name: Lint with ruff
run: ruff check src/ tests/

- name: Type check (ty — advisory)
- name: Type check (ty)
if: matrix.python-version == '3.12'
continue-on-error: true
run: |
pip install ty==0.0.55
ty check src
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ testpaths = ["tests"]

[tool.ruff]
line-length = 100
target-version = "py39"
target-version = "py39"
[tool.ty.environment]
python-platform = "linux"
8 changes: 4 additions & 4 deletions src/batch_probe/_probe_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _gpu_cleanup_generic(backend: str = "auto") -> None:

if backend in ("auto", "cupy"):
try:
import cupy as cp
import cupy as cp # ty: ignore[unresolved-import] # optional GPU backend

pool = cp.get_default_memory_pool()
pool.free_all_blocks()
Expand All @@ -40,7 +40,7 @@ def _gpu_cleanup_generic(backend: str = "auto") -> None:

if backend in ("auto", "jax"):
try:
import jax
import jax # ty: ignore[unresolved-import] # optional GPU backend

jax.clear_caches()
except (ImportError, AttributeError):
Expand Down Expand Up @@ -83,7 +83,7 @@ def probe(

Example — CuPy::

import cupy as cp
import cupy as cp # ty: ignore[unresolved-import] # optional GPU backend
from batch_probe import probe

def my_work(n):
Expand Down Expand Up @@ -114,7 +114,7 @@ def my_work(n):
except (ImportError, AttributeError):
pass
try:
import cupy as cp
import cupy as cp # ty: ignore[unresolved-import] # optional GPU backend

oom_exceptions.append(cp.cuda.memory.OutOfMemoryError)
except (ImportError, AttributeError):
Expand Down
Loading