diff --git a/Cargo.toml b/Cargo.toml index 16be6eef..c61434f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,6 @@ [workspace] resolver = "3" -members = [ - "rust/networking", - "rust/exo_pyo3_bindings", - "rust/util", -] +members = ["rust/networking", "rust/exo_pyo3_bindings", "rust/util"] [workspace.package] version = "0.0.1" diff --git a/bench/bench.toml b/bench/bench.toml index 3b3c8c07..2e4298e1 100644 --- a/bench/bench.toml +++ b/bench/bench.toml @@ -2,6 +2,4 @@ # # Lists the suite files to include. Each file defines benchmarks # with shared constraints, topology, and default args. -include = [ - "single-m3-ultra.toml", -] +include = ["single-m3-ultra.toml"] diff --git a/bench/pyproject.toml b/bench/pyproject.toml index a9f9b84f..9243858f 100644 --- a/bench/pyproject.toml +++ b/bench/pyproject.toml @@ -4,13 +4,13 @@ version = "0.1.0" description = "Benchmarking tool for exo distributed inference" requires-python = ">=3.13" dependencies = [ - "httpx>=0.27.0", - "loguru>=0.7.3", - "transformers>=5.0.0", - "huggingface-hub>=0.33.4", - "tiktoken>=0.12.0", - "jinja2>=3.1.0", - "protobuf>=5.29.0", + "httpx>=0.27.0", + "loguru>=0.7.3", + "transformers>=5.0.0", + "huggingface-hub>=0.33.4", + "tiktoken>=0.12.0", + "jinja2>=3.1.0", + "protobuf>=5.29.0", ] [build-system] diff --git a/bench/single-m3-ultra.toml b/bench/single-m3-ultra.toml index 1d167ac9..acb01624 100644 --- a/bench/single-m3-ultra.toml +++ b/bench/single-m3-ultra.toml @@ -2,10 +2,10 @@ # # Shared constraints applied to ALL benchmarks in this file. constraints = [ - "All(MacOsBuild(=25D125))", - "Hosts(=1)", - "All(Chip(m3_ultra))", - "All(GpuCores(=80))", + "All(MacOsBuild(=25D125))", + "Hosts(=1)", + "All(Chip(m3_ultra))", + "All(GpuCores(=80))", ] [topology] diff --git a/flake.nix b/flake.nix index 3bf7d912..14d5a20e 100644 --- a/flake.nix +++ b/flake.nix @@ -108,6 +108,7 @@ package = pkgsSwift.swiftPackages.swift-format; }; shfmt.enable = true; + taplo.enable = true; }; }; diff --git a/pyproject.toml b/pyproject.toml index 9b9e61a3..6f28de11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,31 +5,31 @@ description = "Exo" readme = "README.md" requires-python = ">=3.13" dependencies = [ - "aiofiles>=24.1.0", - "aiohttp>=3.12.14", - "types-aiofiles>=24.1.0.20250708", - "pydantic>=2.11.7", - "fastapi>=0.116.1", - "filelock>=3.18.0", - "rustworkx>=0.17.1", - "huggingface-hub>=0.33.4", - "psutil>=7.0.0", - "loguru>=0.7.3", - "exo_pyo3_bindings", # rust bindings - "anyio==4.11.0", - "mlx; sys_platform == 'darwin'", - "mlx[cpu]==0.30.6; sys_platform == 'linux'", - "mlx-lm==0.30.7", - "tiktoken>=0.12.0", # required for kimi k2 tokenizer - "hypercorn>=0.18.0", - "openai-harmony>=0.0.8", - "httpx>=0.28.1", - "tomlkit>=0.14.0", - "pillow>=11.0,<12.0", # compatibility with mflux - "mflux==0.15.5", - "python-multipart>=0.0.21", - "msgspec>=0.19.0", - "zstandard>=0.23.0", + "aiofiles>=24.1.0", + "aiohttp>=3.12.14", + "types-aiofiles>=24.1.0.20250708", + "pydantic>=2.11.7", + "fastapi>=0.116.1", + "filelock>=3.18.0", + "rustworkx>=0.17.1", + "huggingface-hub>=0.33.4", + "psutil>=7.0.0", + "loguru>=0.7.3", + "exo_pyo3_bindings", # rust bindings + "anyio==4.11.0", + "mlx; sys_platform == 'darwin'", + "mlx[cpu]==0.30.6; sys_platform == 'linux'", + "mlx-lm==0.30.7", + "tiktoken>=0.12.0", # required for kimi k2 tokenizer + "hypercorn>=0.18.0", + "openai-harmony>=0.0.8", + "httpx>=0.28.1", + "tomlkit>=0.14.0", + "pillow>=11.0,<12.0", # compatibility with mflux + "mflux==0.15.5", + "python-multipart>=0.0.21", + "msgspec>=0.19.0", + "zstandard>=0.23.0", ] [project.scripts] @@ -38,12 +38,12 @@ exo = "exo.main:main" # dependencies only required for development [dependency-groups] dev = [ - "basedpyright>=1.29.0", - "pyinstaller>=6.17.0", - "pytest>=8.4.0", - "pytest-asyncio>=1.0.0", - "pytest-env", - "ruff>=0.11.13", + "basedpyright>=1.29.0", + "pyinstaller>=6.17.0", + "pytest>=8.4.0", + "pytest-asyncio>=1.0.0", + "pytest-env", + "ruff>=0.11.13", ] # mlx[cuda] requires a newer version of mlx. the ideal on linux is: default to mlx[cpu] unless[cuda] specified. @@ -57,10 +57,7 @@ dev = [ ### [tool.uv.workspace] -members = [ - "rust/exo_pyo3_bindings", - "bench", -] +members = ["rust/exo_pyo3_bindings", "bench"] [tool.uv.sources] exo_pyo3_bindings = { workspace = true } @@ -95,7 +92,15 @@ reportUnnecessaryTypeIgnoreComment = "error" pythonVersion = "3.13" pythonPlatform = "Darwin" -exclude = ["**/.venv", "**/venv", "**/__pycache__", "**/exo_scripts", "**/.direnv", "**/rust", "**/.github"] +exclude = [ + "**/.venv", + "**/venv", + "**/__pycache__", + "**/exo_scripts", + "**/.direnv", + "**/rust", + "**/.github", +] stubPath = ".mlx_typings" [[tool.basedpyright.executionEnvironments]] @@ -109,17 +114,18 @@ root = "src" [tool.uv] required-version = ">=0.8.6" prerelease = "allow" -environments = [ - "sys_platform == 'darwin'", - "sys_platform == 'linux'", -] +environments = ["sys_platform == 'darwin'", "sys_platform == 'linux'"] ### # ruff configuration ### [tool.ruff] -extend-exclude = ["shared/protobufs/**", "*mlx_typings/**", "rust/exo_pyo3_bindings/**"] +extend-exclude = [ + "shared/protobufs/**", + "*mlx_typings/**", + "rust/exo_pyo3_bindings/**", +] [tool.ruff.lint] extend-select = ["I", "N", "B", "A", "PIE", "SIM"] @@ -127,13 +133,7 @@ extend-select = ["I", "N", "B", "A", "PIE", "SIM"] [tool.pytest.ini_options] pythonpath = "." asyncio_mode = "auto" -markers = [ - "slow: marks tests as slow (deselected by default)" -] -env = [ - "EXO_TESTS=1" -] +markers = ["slow: marks tests as slow (deselected by default)"] +env = ["EXO_TESTS=1"] addopts = "-m 'not slow' --ignore=tests/start_distributed_test.py" -filterwarnings = [ - "ignore:builtin type Swig:DeprecationWarning", -] +filterwarnings = ["ignore:builtin type Swig:DeprecationWarning"] diff --git a/rust/exo_pyo3_bindings/Cargo.toml b/rust/exo_pyo3_bindings/Cargo.toml index 77777055..e7577ab7 100644 --- a/rust/exo_pyo3_bindings/Cargo.toml +++ b/rust/exo_pyo3_bindings/Cargo.toml @@ -26,20 +26,24 @@ networking = { workspace = true } # interop pyo3 = { version = "0.27.2", features = [ - # "abi3-py313", # tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.13 - # "nightly", # enables better-supported GIL integration - "experimental-async", # async support in #[pyfunction] & #[pymethods] - #"experimental-inspect", # inspection of generated binary => easier to automate type-hint generation - #"py-clone", # adding Clone-ing of `Py` without GIL (may cause panics - remove if panics happen) - # "multiple-pymethods", # allows multiple #[pymethods] sections per class + # "abi3-py313", # tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.13 + # "nightly", # enables better-supported GIL integration + "experimental-async", # async support in #[pyfunction] & #[pymethods] + #"experimental-inspect", # inspection of generated binary => easier to automate type-hint generation + #"py-clone", # adding Clone-ing of `Py` without GIL (may cause panics - remove if panics happen) + # "multiple-pymethods", # allows multiple #[pymethods] sections per class - # integrations with other libraries - # "arc_lock", "bigdecimal", "either", "hashbrown", "indexmap", "num-bigint", "num-complex", "num-rational", - # "ordered-float", "rust_decimal", "smallvec", - # "anyhow", "chrono", "chrono-local", "chrono-tz", "eyre", "jiff-02", "lock_api", "parking-lot", "time", "serde", + # integrations with other libraries + # "arc_lock", "bigdecimal", "either", "hashbrown", "indexmap", "num-bigint", "num-complex", "num-rational", + # "ordered-float", "rust_decimal", "smallvec", + # "anyhow", "chrono", "chrono-local", "chrono-tz", "eyre", "jiff-02", "lock_api", "parking-lot", "time", "serde", ] } pyo3-stub-gen = { version = "0.17.2" } -pyo3-async-runtimes = { version = "0.27.0", features = ["attributes", "tokio-runtime", "testing"] } +pyo3-async-runtimes = { version = "0.27.0", features = [ + "attributes", + "tokio-runtime", + "testing", +] } pyo3-log = "0.13.2" # macro dependencies diff --git a/rust/exo_pyo3_bindings/pyproject.toml b/rust/exo_pyo3_bindings/pyproject.toml index f7f23739..9b5cfa95 100644 --- a/rust/exo_pyo3_bindings/pyproject.toml +++ b/rust/exo_pyo3_bindings/pyproject.toml @@ -8,18 +8,14 @@ version = "0.2.0" description = "Add your description here" readme = "README.md" authors = [ - { name = "Andrei Cravtov", email = "the.andrei.cravtov@gmail.com" }, - { name = "Evan Quiney", email = "evanev7@gmail.com" } + { name = "Andrei Cravtov", email = "the.andrei.cravtov@gmail.com" }, + { name = "Evan Quiney", email = "evanev7@gmail.com" }, ] requires-python = ">=3.13" dependencies = [] [dependency-groups] -dev = [ - "exo_pyo3_bindings", - "pytest>=8.4.0", - "pytest-asyncio>=1.0.0", -] +dev = ["exo_pyo3_bindings", "pytest>=8.4.0", "pytest-asyncio>=1.0.0"] [tool.maturin] #purelib = true diff --git a/rust/networking/Cargo.toml b/rust/networking/Cargo.toml index 80d6dbf5..3aff54d6 100644 --- a/rust/networking/Cargo.toml +++ b/rust/networking/Cargo.toml @@ -28,7 +28,10 @@ tokio = { workspace = true, features = ["full"] } # utility dependencies util = { workspace = true } -tracing-subscriber = { version = "0.3.19", features = ["default", "env-filter"] } +tracing-subscriber = { version = "0.3.19", features = [ + "default", + "env-filter", +] } keccak-const = { workspace = true } # tracing/logging