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
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
release:
types: [released]
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
Expand All @@ -25,7 +25,7 @@ jobs:
run: |
set -x
pip install --upgrade pip
pip install -U pdm twine torch==2.1.2 setuptools
pip install -U 'pdm<2.16.0' twine torch==2.3.0 setuptools
pdm build -vv
- name: Release to PyPI
if: ${{ github.event_name == 'release' }}
Expand All @@ -51,7 +51,7 @@ jobs:
run: |
$env:PATH="$env:APPDATA\Python\Library\Bin;$env:PATH"
pip install --upgrade pip
pip install -U pdm twine torch==2.1.2 setuptools
pip install -U 'pdm<2.16.0' twine torch==2.1.2 setuptools
pdm build -vv
- name: Release to PyPI
if: ${{ github.event_name == 'release' }}
Expand Down
117 changes: 53 additions & 64 deletions pdm.lock

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

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ authors = [
]
dependencies = [
"daemonize>=2.5.0",
"torch>=2.1.2",
"torch>=2.3.0",
]
requires-python = ">=3.9"
requires-python = ">=3.10"
readme = "README.md"
license = {text = "Apache"}

Expand All @@ -20,7 +20,7 @@ overmind-shutdown= "overmind.cli:shutdown"
overmind-drop-shell= "overmind.cli:drop_shell"

[build-system]
requires = ["pdm-backend", "torch==2.1.2", "setuptools<70.0.0", "numpy"]
requires = ["pdm-backend", "torch==2.3.0", "setuptools<70.0.0", "numpy"]
build-backend = "pdm.backend"

[tool.pdm]
Expand Down
5 changes: 3 additions & 2 deletions src/overmind/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# -- stdlib --
from functools import lru_cache
from multiprocessing.connection import Client
from multiprocessing.reduction import ForkingPickler as Pickler
from pathlib import Path
from typing import Any
import importlib
Expand Down Expand Up @@ -146,6 +145,8 @@ def _local_cached_load(self, fn, args, kwargs):
return ret

def load(self, fn, *args, **kwargs):
from .reducer import OvermindUnpicker as Unpickler

if os.environ.get('OVERMIND_DISABLE'):
log.warning('overmind disabled by OVERMIND_DISABLE env variable, loading model directly')
return self._local_cached_load(fn, args, kwargs)
Expand All @@ -169,7 +170,7 @@ def replace_ref(obj):
b4 = time.time()
b: bytes = self._call('load', fn, args, kwargs)
rpc_time = time.time() - b4
obj = Pickler.loads(Pickler.loads(b))
obj = Unpickler.loads(Unpickler.loads(b))
log.info(f'Loaded {disp} in {time.time() - b4:.3f}s (rpc: {rpc_time:.3f}s)')
return obj

Expand Down
7 changes: 5 additions & 2 deletions src/overmind/csrc/omhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ void initOvermindHelpers(py::module m) {
auto size = info->size;
auto ptr = info->ptr;

return pybind11::reinterpret_steal<py::object>(THPStorage_New(

return pybind11::reinterpret_steal<py::object>(THPStorage_NewWithStorage(
THPStorageClass,
c10::make_intrusive<at::StorageImpl>(
c10::StorageImpl::use_byte_size_t(),
size,
Expand All @@ -160,7 +162,8 @@ void initOvermindHelpers(py::module m) {
at::DeviceType::CPU
),
/*allocator=*/nullptr,
/*resizable=*/false)
/*resizable=*/false),
c10::impl::PyInterpreterStatus::DEFINITELY_UNINITIALIZED
)
);
});
Expand Down
Loading