diff --git a/README.md b/README.md index 28fcd94..3367058 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,17 @@ pip install -e . ``` +### Platform Compatibility + +Tokasaurus uses `flashinfer`, which depends on [Triton](https://github.com/triton-lang/triton). + +**Triton is not supported on macOS** — there are no compatible wheels or source build paths, and it requires CUDA (not available on macOS). + +If you're running Tokasaurus on macOS, you'll encounter an error like: ModuleNotFoundError: No module named ‘triton’ + +We recommend running Tokasaurus in a **Linux environment with a CUDA-compatible GPU** for full functionality. + + ## Quickstart Once installed, you can launch the engine with: diff --git a/tokasaurus/entry.py b/tokasaurus/entry.py index 9cf9d78..15c1190 100644 --- a/tokasaurus/entry.py +++ b/tokasaurus/entry.py @@ -1,3 +1,6 @@ +from tokasaurus.environment import assert_flashinfer_supported + +assert_flashinfer_supported() from contextlib import contextmanager import pydra diff --git a/tokasaurus/environment.py b/tokasaurus/environment.py new file mode 100644 index 0000000..2a201fc --- /dev/null +++ b/tokasaurus/environment.py @@ -0,0 +1,21 @@ +import platform + + +def is_flashinfer_supported() -> bool: + """ + Returns True if flashinfer (and Triton) are likely usable on this platform. + Currently, Triton does not support macOS. + """ + return platform.system() != "Darwin" + + +def assert_flashinfer_supported(): + """ + Raises a RuntimeError with a clear message if the current platform is not supported by flashinfer. + """ + if not is_flashinfer_supported(): + raise RuntimeError( + "Tokasaurus currently depends on flashinfer, which in turn requires 'triton'.\n" + "However, 'triton' is not supported on macOS.\n" + "Please run Tokasaurus in a Linux environment with a supported GPU." + )