[build-system] requires = ["uv_build>=0.9.18,<0.10.0"] build-backend = "uv_build" [project] name = "areal" description = "AReaL: A Large-Scale Asynchronous Reinforcement Learning System" readme = "README.md" license = {text = "Apache-2.0"} requires-python = ">=3.11,<3.13" version = "2.1.0" authors = [ {name = "AReaL Team"}, ] maintainers = [ {name = "AReaL Team"}, ] keywords = [ "distributed-systems", "reinforcement-learning", "large-language-models", "llm-training", "llm-agent", "agentic-rl", ] classifiers = [ # 3 - Alpha # 4 - Beta # 5 - Production/Stable "Development Status :: 2 - Pre-Alpha", "Environment :: GPU :: NVIDIA CUDA :: 12", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: System :: Distributed Computing", ] dependencies = [ # Core ML/AI libraries "torch>=2.9.1,<2.11; sys_platform != 'darwin' or platform_machine != 'x86_64'", "torch<2.9.1; sys_platform == 'darwin' and platform_machine == 'x86_64'", "torchaudio", "torchvision", "torchdata", "huggingface_hub", "datasets>=3.0.0", "transformers>=5.0.0,<=5.3.0", "mistral-common>=1.11.1", "peft<=0.18.1", "qwen_agent", "openai-agents", "anthropic", "claude-agent-sdk", "litellm[proxy]>=1.81.3", "openhands", "langchain", "langchain-openai", # Visualization "pandas", "matplotlib", "seaborn", # Utilities and data processing "pillow>=12.1.1", "pylatexenc", "zstandard", "setproctitle", "nltk", "sentencepiece", "einops", "orjson", "tqdm", "rich", "pydantic", "PyYAML", "omegaconf==2.4.0.dev2", "hydra-core==1.4.0.dev1", "packaging", "lark", "tabulate", "pybase64", "msgspec", "math-verify==0.8.0", "python-dotenv", "json5", "psutil", "nvidia-ml-py; sys_platform == 'linux'", "ninja", "numba", "pybind11>=2.10.0", "networkx==3.3", "aiofiles", "aiohttp>=3.13.3,<4", "httpx>=0.28.1", "pyzmq", "regex", "python_dateutil", "word2number", "pebble", "timeout-decorator", "prettytable", "h5py", "mathruler==0.1.0", # Monitoring and logging "wandb", "tensorboardx", "trackio", "colorama", "colorlog", "swanboard==0.1.9b1", "swanlab[dashboard]==0.6.12", # Distributed computing "ray[default]", "redis", "awex==0.9.0", # Web frameworks "fastapi>=0.115.12", "uvicorn", "uvloop>=0.21.0", "flask", "tenacity>=8.2.0", # Build and packaging tools "build>=1.2.1", "wheel>=0.43.0", "cookiecutter>2.1.1", "distro-info>=1.0", "python-debian>=0.1.49", ] [project.optional-dependencies] # CUDA-dependent extras - these packages only have Linux x86_64 wheels # Platform markers ensure they're skipped on unsupported platforms # # NOTE: vLLM has a separate pyproject file (pyproject.vllm.toml) because # sglang and vllm pin mutually-incompatible torch / torchao versions. # See pyproject.vllm.toml for the vLLM variant. sglang = [ "sglang[tracing]==0.5.10.post1; sys_platform == 'linux' and platform_machine == 'x86_64'", "nvidia-cudnn-cu12==9.19.0.56; sys_platform == 'linux' and platform_machine == 'x86_64'", "torch; sys_platform == 'linux' and platform_machine == 'x86_64'", "torchaudio; sys_platform == 'linux' and platform_machine == 'x86_64'", "torchvision; sys_platform == 'linux' and platform_machine == 'x86_64'", ] tms = [ "torch_memory_saver==0.0.9; sys_platform == 'linux'", ] kernels = [ "kernels==0.12.2", ] megatron = [ "megatron-core==0.19.0; python_version >= '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'", "mbridge @ git+https://github.com/ISEEKYAN/mbridge.git@310e8fb; sys_platform == 'linux' and platform_machine == 'x86_64'", "megatron-bridge==0.6.0; python_version >= '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'", ] # Convenience extra for CUDA training packages (no inference backend) cuda-train = [ "areal[tms]", "areal[megatron]", "areal[kernels]", "nvidia-modelopt[hf]; sys_platform == 'linux' and platform_machine == 'x86_64'", "tilelang>=0.1.9; sys_platform == 'linux' and platform_machine == 'x86_64'", "flash-linear-attention==0.4.2; sys_platform == 'linux' and platform_machine == 'x86_64'", ] # Full CUDA setup: training packages + SGLang inference cuda = [ "areal[cuda-train]", "areal[sglang]", "torch; sys_platform == 'linux' and platform_machine == 'x86_64'", "torchaudio; sys_platform == 'linux' and platform_machine == 'x86_64'", "torchvision; sys_platform == 'linux' and platform_machine == 'x86_64'", ] sandbox = [ "daytona>=0.167.0", ] cli = [ "click>=8.1", "colorlog", ] [project.scripts] areal = "areal.v2.cli.main:cli" [project.urls] "Homepage" = "https://github.com/areal-project/AReaL" "Repository" = "https://github.com/areal-project/AReaL" "Documentation" = "https://areal-project.github.io/AReaL/en/intro.html" "Bug Tracker" = "https://github.com/areal-project/AReaL/issues" [dependency-groups] dev = [ "pytest", "pytest-asyncio", "ipython", "ruff==0.14.9", "clang-format==19.1.7", "sh", "mdformat==0.7.17", "mdformat-gfm", "mdformat-tables", "mdformat-frontmatter", "plotly", "pre-commit", "sphinx", "sphinx-nefertiti", "jupyter-book==1.0.4.post1", ] # ============================================================================= # Tool configurations: uv # ============================================================================= [tool.uv.build-backend] # Package is in root directory (not src/), so set module-root to empty string module-root = "" [tool.uv] # Restrict lock file resolution to supported environments # This prevents uv from failing when CUDA-only packages don't have wheels for macOS environments = [ "sys_platform == 'linux' and platform_machine == 'x86_64'", "sys_platform == 'linux' and platform_machine == 'aarch64'", "sys_platform == 'darwin' and platform_machine == 'arm64'", "sys_platform == 'darwin' and platform_machine == 'x86_64'", ] override-dependencies = [ # litellm[proxy] conflicts with sglang's exact pins: # - litellm requires openai>=2.8.0, sglang pins openai==2.6.1 # - litellm requires soundfile>=0.12.1,<0.13.0, sglang pins soundfile==0.13.1 # sglang pins torchao==0.9.0, but we require >=0.15.0 for archon fp8 # nvidia-cudnn-cu12 is required for SGLang Vision Models "openai>=2.8.0", "soundfile>=0.12.1,<0.13.0", "torchao==0.15.0", "nvidia-cudnn-cu12==9.19.0.56; sys_platform == 'linux' and platform_machine == 'x86_64'", "flash-attn-4>=4.0.0b4", # Required by megatron-bridge but are optional (as per docs) cuda-based installs "transformer-engine; sys_platform == 'never'", "nv-grouped-gemm; sys_platform == 'never'", "mamba-ssm; sys_platform == 'never'", "causal-conv1d; sys_platform == 'never'", # Megatron-Bridge only uses this CUDA extension for GLM-5/DeepSeek-V4 DSA, # which AReaL does not currently expose. It requires nvcc at install time. "fast-hadamard-transform; sys_platform == 'never'", # nvidia-resiliency-ext 0.6.0 only ships manylinux_2_39 wheels; exclude so # older host kernels can still install megatron-core. "nvidia-resiliency-ext; sys_platform == 'never'", # Version conflicts with megatron-bridge (resorting to the existing version) "megatron-core==0.19.0; python_version >= '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'", "hydra-core==1.4.0.dev1", "timm==1.0.16", "transformers>=5.0.0,<=5.3.0", # Keep the SGLang runtime's matched FlashInfer pair. Megatron-Bridge uses # FlashInfer only in optional inference paths that AReaL does not invoke. "flashinfer-cubin==0.6.7.post3; sys_platform == 'linux' and platform_machine == 'x86_64'", "flashinfer-python==0.6.7.post3; sys_platform == 'linux' and platform_machine == 'x86_64'", ] [[tool.uv.dependency-metadata]] name = "megatron-bridge" version = "0.6.0" requires-dist = [ "accelerate", "comet-ml>=3.50.0", "datasets>=2.20.0", "diffusers>=0.36.0", "einops", "fast-hadamard-transform>=1.1.0", "flash-linear-attention", "flashinfer-cubin==0.6.8.post1", "flashinfer-python==0.6.8.post1", "hydra-core>1.3,<=1.3.2", "megatron-core[dev,mlm]", "mistral-common>=1.10.0", "mlflow>=3.15.1", "nvidia-resiliency-ext", "omegaconf>=2.3.0", "open-clip-torch>=3.2.0", "peft>=0.18.1", "pyyaml>=6.0.2", "qwen-vl-utils", "regex>=2024.11.6", "rich", "six>=1.17.0", "tensorboard>=2.19.0", "timm", "torch>=2.6.0", "tqdm>=4.67.1", "transformers>=5.8,<=5.12.1", "typing-extensions", "wandb==0.27.2", ] [[tool.uv.index]] name = "pytorch-cu129" url = "https://download.pytorch.org/whl/cu129" explicit = true [tool.uv.sources] megatron-bridge = { url = "https://github.com/sitabulaixizawaluduo/Megatron-Bridge/releases/download/areal-v0.6.0-exaone45-fix.2/megatron_bridge-0.6.0-py3-none-any.whl" } torch = [ { index = "pytorch-cu129", extra = "sglang" }, { index = "pytorch-cu129", extra = "cuda" }, ] torchaudio = [ { index = "pytorch-cu129", extra = "sglang" }, { index = "pytorch-cu129", extra = "cuda" }, ] torchvision = [ { index = "pytorch-cu129", extra = "sglang" }, { index = "pytorch-cu129", extra = "cuda" }, ] # ============================================================================= # Tool configurations: pytest # ============================================================================= [tool.pytest.ini_options] pythonpath = ["."] filterwarnings = [ "ignore::DeprecationWarning", "ignore::PendingDeprecationWarning", "ignore::FutureWarning", "ignore::UserWarning:torch.*", "ignore::UserWarning:transformers.*", ] markers = [ "slow: mark test as slow, expected to cost more than 30 seconds and will not run in CI by default.", "ci: mark test as must-run in CI (only marked for slow tests).", "gpu: mark test that uses a single GPU", "multi_gpu: mark test that uses more than one GPU", "sglang: mark test that requires the SGLang inference backend", "vllm: mark test that requires the vLLM inference backend", "integration: requires external services or credentials", ] # ============================================================================= # Tool configurations: ruff # ============================================================================= [tool.ruff] line-length = 88 target-version = "py311" [tool.ruff.lint] select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # pyflakes "I", # isort "UP", # pyupgrade ] ignore = [ "E501", # E501 Line too long ] [tool.ruff.lint.isort] section-order = [ "future", "standard-library", "third-party", "first-party", "areal", "local-folder", ] from-first = false [tool.ruff.lint.isort.sections] "areal" = ["areal"]