Metadata-Version: 2.4
Name: talon-graph
Version: 0.0.1
Summary: TALON Graph: Graph partitioning, core mapping, and spatial routing for Talon IR
Author-email: Anurag Daram <anurag@type1compute.com>, Subham Kumar Das <subham@type1compute.com>
Maintainer-email: Type 1 Compute <dev@type1compute.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/type1compute/talongraph
Project-URL: Documentation, https://type1compute.github.io/docs/talon-ecosystem/introduction
Project-URL: Repository, https://github.com/type1compute/talongraph.git
Project-URL: Issues, https://github.com/type1compute/talongraph/-/issues
Project-URL: Changelog, https://github.com/type1compute/talongraph/-/releases
Keywords: talon,neuromorphic,spiking-neural-networks,graph-partitioning,hardware-mapping,spatial-routing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: talon-ir
Requires-Dist: numpy<3,>=1.24.0
Requires-Dist: rustworkx>=0.14.0
Requires-Dist: scipy>=1.10.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
Requires-Dist: Cython>=3.0; extra == "dev"
Requires-Dist: inline-snapshot>=0.31.0; extra == "dev"
Dynamic: license-file

# TALON Graph Partitioning and Mapping

Graph partitioning, core mapping, and spatial routing for TALON IR graphs. Takes IR graphs and produces placed graphs with core assignments and routing tables for hardware deployment.

## Installation

```bash
uv add talon-graph
```

## Features

- **Graph Partitioning**: EdgeMap, spectral bisection, and greedy algorithms
- **Core Placement**: Minimize spike-hop distance across hardware mesh
- **Spike Routing**: Forward and feedback routing tables via RustworkX shortest paths
- **Resource Allocation**: Per-core memory budgets (weights, neuron state, routing buffers)
- **DAG + Cyclic Support**: Auto-detects topology, co-locates SCCs on same core

## Quick Start

```python
from talon import ir, graph

# Load a TALON IR graph
g = ir.read("model.t1c")

# Define hardware constraints
from talon.graph import HardwareSpec
hw = HardwareSpec(max_neurons_per_core=256, sram_bytes_per_core=65536)

# Partition and route
placed = graph.partition(g, hw, algorithm="edgemap")
placed = graph.route(placed, hw)

# Inspect assignments
for name, node in placed.nodes.items():
    if hasattr(node, 'core_id') and node.core_id is not None:
        print(f"  {name} -> core {node.core_id}")
```

## License

MIT
