Metadata-Version: 2.4
Name: wafer-core
Version: 0.1.0
Summary: Core utilities and environments for Wafer GPU kernel optimization
Author-email: Wafer <team@wafer.dev>
License: MIT
Keywords: compiler,cuda,gpu,kernel,optimization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: anthropic>=0.40.0
Requires-Dist: anyio>=4.0.0
Requires-Dist: asyncssh>=2.14.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: modal>=0.64.0
Requires-Dist: paramiko>=3.4.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: trio-asyncio>=0.15.0
Requires-Dist: trio>=0.24.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# wafer-core

Core utilities and environments for Wafer GPU kernel optimization.

## Features

- **CUDA Compilation Tools**: Compile CUDA files to PTX/SASS, detect GPU architecture
- **Tool Finding**: Locate CUDA toolkit executables (nvcc, nvdisasm)
- **Telemetry**: Decorator-based telemetry system with hooks
- **Environments**: GPU kernel optimization environments
- **Remote Execution**: SSH and Modal-based remote GPU execution
- **Sessions**: Agent session management
- **Logging**: Structured logging with color and JSON formatters

## Installation

```bash
pip install wafer-core
```

**Note**: For full functionality including environments and sessions, you may also need to install `rollouts`:
```bash
pip install git+https://github.com/arb8020/research.git#subdirectory=rollouts
```

The core tools (CUDA compilation, tool finding, telemetry) work without rollouts.

## Quick Start

```python
from wafer_core import compile_cuda, detect_arch, find_nvcc

# Detect GPU architecture
arch_info = detect_arch()
print(f"Detected architecture: {arch_info['arch']}")

# Compile CUDA file
result = compile_cuda("kernel.cu", arch="sm_90")
print(f"PTX: {result.ptx}")
print(f"SASS: {result.sass}")

# Find nvcc
nvcc_path = find_nvcc()
if nvcc_path:
    print(f"Found nvcc at: {nvcc_path}")
```

## Documentation

See the [Wafer documentation](https://wafer.dev/docs) for more information.

## License

MIT License

