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

bug: 'site-packages/mosec/bin/mosec' not found on macOS M1 #507

Closed
oliverhu opened this issue Feb 27, 2024 · 3 comments · Fixed by #508
Closed

bug: 'site-packages/mosec/bin/mosec' not found on macOS M1 #507

oliverhu opened this issue Feb 27, 2024 · 3 comments · Fixed by #508
Labels
bug Something isn't working

Comments

@oliverhu
Copy link

oliverhu commented Feb 27, 2024

Describe the bug

Tried the Echo Example in the mosec documentation and failed to launch.

To Reproduce

Install mosec via pip install -U mosec

Then run the exact same code in echo.py

import time
from typing import List

from mosec import Server, ValidationError, Worker, get_logger

logger = get_logger()


class Preprocess(Worker):
    """Sample Class."""

    example = {"time": 0}

    def forward(self, data: dict) -> float:
        logger.debug("pre received %s", data)
        # Customized, simple input validation
        try:
            count_time = float(data["time"])
        except KeyError as err:
            raise ValidationError(f"cannot find key {err}") from err
        return count_time


class Inference(Worker):
    """Sample Class."""

    example = [0, 1e-5, 2e-4]

    def forward(self, data: List[float]) -> List[float]:
        logger.info("sleeping for %s seconds", max(data))
        time.sleep(max(data))
        return data


class Postprocess(Worker):
    """Sample Class."""

    def forward(self, data: float) -> dict:
        logger.debug("post received %f", data)
        return {"msg": f"sleep {data} seconds"}


if __name__ == "__main__":
    server = Server()
    server.append_worker(Preprocess)
    server.append_worker(Inference, max_batch_size=32)
    server.append_worker(Postprocess)
    server.run()

and run with:
python echo.py

Expected behavior

No response

The mosec version

mosec-0.8.3
Python 3.10.0
macOS Sonoma, M1 Macbook Pro

Additional context

Only fails in macOS, it works on my Linux box.

@oliverhu oliverhu added the bug Something isn't working label Feb 27, 2024
@kemingy kemingy changed the title bug: 'site-packages/mosec/bin/mosec' not found bug: 'site-packages/mosec/bin/mosec' not found on macOS M1 Feb 27, 2024
@kemingy
Copy link
Member

kemingy commented Feb 27, 2024

There is no ARM release now. I think we can add it since GitHub has ARM runners.

Related to the upstream issues:

@kemingy
Copy link
Member

kemingy commented Feb 27, 2024

Hi @oliverhu, 0.8.4 is released with macOS ARM64 support. You can try it with pip install mosec==0.8.4 on macOS M1.

@oliverhu
Copy link
Author

@kemingy thanks for the prompt response & fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants