nxbench


Namenxbench JSON
Version 0.1.15 PyPI version JSON
download
home_pageNone
SummaryA centralized benchmarking suite to facilitate comparative profiling of tools across graph analytic libraries and datasets
upload_time2024-12-16 21:40:28
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords networkx graph network benchmarking profiling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Python](https://img.shields.io/pypi/pyversions/nxbench.svg)](https://badge.fury.io/py/nxbench)
[![PyPI](https://badge.fury.io/py/nxbench.svg)](https://badge.fury.io/py/nxbench)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# NxBench

<p align="center">
  <img src="doc/_static/assets/nxbench_logo.png" alt="NxBench Logo" width="150"/>
</p>

**nxbench** is a comprehensive benchmarking suite designed to facilitate comparative profiling of graph analytic algorithms across NetworkX and compatible backends. Built on top of [Airspeed Velocity (ASV)](https://github.com/airspeed-velocity/asv), nxbench places an emphasis on extensible and granular performance analysis, enabling developers and researchers to optimize their graph analysis workflows efficiently and reproducibly.

## Key Features

- **Cross-Backend Benchmarking**: Leverage NetworkX's backend system to profile algorithms across multiple implementations (NetworkX, nx-parallel, GraphBLAS, and CuGraph)
- **Configurable Suite**: YAML-based configuration for algorithms, datasets, and benchmarking parameters
- **Real-World Datasets**: Automated downloading and caching of networks and their metadata from NetworkRepository
- **Synthetic Graph Generation**: Support for generating benchmark graphs using any of NetworkX's built-in generators
- **Validation Framework**: Comprehensive result validation for correctness across implementations
- **Performance Monitoring**: Track execution time and memory usage with detailed metrics
- **Interactive Visualization**: Dynamic dashboard for exploring benchmark results using Plotly Dash
- **Flexible Storage**: SQLite-based result storage with pandas integration for analysis
- **CI Integration**: Support for automated benchmarking through ASV (Airspeed Velocity)

## Installation

PyPi:

```bash
pip install nxbench
```

From a local clone:

```bash
make install
```

Docker:

```bash
# CPU-only
docker-compose -f docker/docker-compose.cpu.yaml build

# With GPU
docker-compose -f docker/docker-compose.gpu.yaml build
```

## Quick Start

1. Configure your benchmarks in a yaml file (see `configs/example.yaml`):

```yaml
algorithms:
  - name: "pagerank"
    func: "networkx.pagerank"
    params:
      alpha: 0.85
    groups: ["centrality"]

datasets:
  - name: "karate"
    source: "networkrepository"
```

2. Run benchmarks based on the configuration:

```bash
nxbench --config 'nxbench/configs/example.yaml' benchmark run
```

3. Export results:

```bash
nxbench --config 'nxbench/configs/example.yaml' benchmark export 'results/results.csv' --output-format csv  # convert benchmarked results into csv format.
```

4. View results:

```bash
nxbench viz serve  # visualize results using parallel categories dashboard
```

<p align="center">
  <img src="doc/_static/assets/animation.gif" alt="Parallel Categories Animation" width="1000"/>
</p>


## Advanced Command Line Interface

The CLI provides comprehensive management of benchmarks, datasets, and visualization:

```bash
# Data Management
nxbench data download karate  # download specific dataset
nxbench data list --category social  # list available datasets

# Benchmarking
nxbench --config 'nxbench/configs/example.yaml' -vvv benchmark run  # debug benchmark runs
nxbench --config 'nxbench/configs/example.yaml' benchmark export 'results/benchmarks.sqlite' --output-format sql # export the results into a sql database
```

## Configuration

Benchmarks are configured through YAML files with the following structure:

```yaml
algorithms:
  - name: "algorithm_name"
    func: "fully.qualified.function.name"
    params: {}
    requires_directed: false
    groups: ["category"]
    validate_result: "validation.function"

datasets:
  - name: "dataset_name"
    source: "networkrepository"
    params: {}
```

## Supported Backends

- NetworkX (default)
- nx-CuGraph (requires separate CuGraph installation and supported GPU hardware)
- GraphBLAS Algorithms (optional)
- nx-parallel (optional)

## Reproducible benchmarking through containerization

```bash
# Run benchmarks with GPU
NUM_GPU=1 docker-compose -f docker/docker-compose.gpu.yaml up nxbench

# Run benchmarks CPU-only
docker-compose -f docker/docker-compose.cpu.yaml up nxbench

# Start visualization dashboard
docker-compose -f docker/docker-compose.cpu.yaml up dashboard

# Run specific backend
docker-compose -f docker/docker-compose.cpu.yaml run --rm nxbench --config 'nxbench/configs/example.yaml' benchmark run --backend networkx

# View results
docker-compose -f docker/docker-compose.cpu.yaml run --rm nxbench --config 'nxbench/configs/example.yaml' benchmark export results.csv
```

## Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on:

- Code style guidelines
- Development setup
- Testing requirements
- Pull request process

## License

This project is licensed under the MIT License - see [LICENSE](LICENSE) for details.

## Acknowledgments

- NetworkX community for the core graph library and dispatching support
- NetworkRepository.com for harmonized dataset access
- ASV team for benchmark infrastructure

## Contact

For questions or suggestions:

- Open an issue on GitHub
- Email: <dpysalexander@gmail.com>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nxbench",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "networkx, graph, network, benchmarking, profiling",
    "author": null,
    "author_email": "Derek Alexander <dpysalexander@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b6/0d/ff0718454256a3403c4184957d26bb388ca0bdda763ca09482624e398d82/nxbench-0.1.15.tar.gz",
    "platform": null,
    "description": "[![Python](https://img.shields.io/pypi/pyversions/nxbench.svg)](https://badge.fury.io/py/nxbench)\n[![PyPI](https://badge.fury.io/py/nxbench.svg)](https://badge.fury.io/py/nxbench)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n# NxBench\n\n<p align=\"center\">\n  <img src=\"doc/_static/assets/nxbench_logo.png\" alt=\"NxBench Logo\" width=\"150\"/>\n</p>\n\n**nxbench** is a comprehensive benchmarking suite designed to facilitate comparative profiling of graph analytic algorithms across NetworkX and compatible backends. Built on top of [Airspeed Velocity (ASV)](https://github.com/airspeed-velocity/asv), nxbench places an emphasis on extensible and granular performance analysis, enabling developers and researchers to optimize their graph analysis workflows efficiently and reproducibly.\n\n## Key Features\n\n- **Cross-Backend Benchmarking**: Leverage NetworkX's backend system to profile algorithms across multiple implementations (NetworkX, nx-parallel, GraphBLAS, and CuGraph)\n- **Configurable Suite**: YAML-based configuration for algorithms, datasets, and benchmarking parameters\n- **Real-World Datasets**: Automated downloading and caching of networks and their metadata from NetworkRepository\n- **Synthetic Graph Generation**: Support for generating benchmark graphs using any of NetworkX's built-in generators\n- **Validation Framework**: Comprehensive result validation for correctness across implementations\n- **Performance Monitoring**: Track execution time and memory usage with detailed metrics\n- **Interactive Visualization**: Dynamic dashboard for exploring benchmark results using Plotly Dash\n- **Flexible Storage**: SQLite-based result storage with pandas integration for analysis\n- **CI Integration**: Support for automated benchmarking through ASV (Airspeed Velocity)\n\n## Installation\n\nPyPi:\n\n```bash\npip install nxbench\n```\n\nFrom a local clone:\n\n```bash\nmake install\n```\n\nDocker:\n\n```bash\n# CPU-only\ndocker-compose -f docker/docker-compose.cpu.yaml build\n\n# With GPU\ndocker-compose -f docker/docker-compose.gpu.yaml build\n```\n\n## Quick Start\n\n1. Configure your benchmarks in a yaml file (see `configs/example.yaml`):\n\n```yaml\nalgorithms:\n  - name: \"pagerank\"\n    func: \"networkx.pagerank\"\n    params:\n      alpha: 0.85\n    groups: [\"centrality\"]\n\ndatasets:\n  - name: \"karate\"\n    source: \"networkrepository\"\n```\n\n2. Run benchmarks based on the configuration:\n\n```bash\nnxbench --config 'nxbench/configs/example.yaml' benchmark run\n```\n\n3. Export results:\n\n```bash\nnxbench --config 'nxbench/configs/example.yaml' benchmark export 'results/results.csv' --output-format csv  # convert benchmarked results into csv format.\n```\n\n4. View results:\n\n```bash\nnxbench viz serve  # visualize results using parallel categories dashboard\n```\n\n<p align=\"center\">\n  <img src=\"doc/_static/assets/animation.gif\" alt=\"Parallel Categories Animation\" width=\"1000\"/>\n</p>\n\n\n## Advanced Command Line Interface\n\nThe CLI provides comprehensive management of benchmarks, datasets, and visualization:\n\n```bash\n# Data Management\nnxbench data download karate  # download specific dataset\nnxbench data list --category social  # list available datasets\n\n# Benchmarking\nnxbench --config 'nxbench/configs/example.yaml' -vvv benchmark run  # debug benchmark runs\nnxbench --config 'nxbench/configs/example.yaml' benchmark export 'results/benchmarks.sqlite' --output-format sql # export the results into a sql database\n```\n\n## Configuration\n\nBenchmarks are configured through YAML files with the following structure:\n\n```yaml\nalgorithms:\n  - name: \"algorithm_name\"\n    func: \"fully.qualified.function.name\"\n    params: {}\n    requires_directed: false\n    groups: [\"category\"]\n    validate_result: \"validation.function\"\n\ndatasets:\n  - name: \"dataset_name\"\n    source: \"networkrepository\"\n    params: {}\n```\n\n## Supported Backends\n\n- NetworkX (default)\n- nx-CuGraph (requires separate CuGraph installation and supported GPU hardware)\n- GraphBLAS Algorithms (optional)\n- nx-parallel (optional)\n\n## Reproducible benchmarking through containerization\n\n```bash\n# Run benchmarks with GPU\nNUM_GPU=1 docker-compose -f docker/docker-compose.gpu.yaml up nxbench\n\n# Run benchmarks CPU-only\ndocker-compose -f docker/docker-compose.cpu.yaml up nxbench\n\n# Start visualization dashboard\ndocker-compose -f docker/docker-compose.cpu.yaml up dashboard\n\n# Run specific backend\ndocker-compose -f docker/docker-compose.cpu.yaml run --rm nxbench --config 'nxbench/configs/example.yaml' benchmark run --backend networkx\n\n# View results\ndocker-compose -f docker/docker-compose.cpu.yaml run --rm nxbench --config 'nxbench/configs/example.yaml' benchmark export results.csv\n```\n\n## Contributing\n\nContributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on:\n\n- Code style guidelines\n- Development setup\n- Testing requirements\n- Pull request process\n\n## License\n\nThis project is licensed under the MIT License - see [LICENSE](LICENSE) for details.\n\n## Acknowledgments\n\n- NetworkX community for the core graph library and dispatching support\n- NetworkRepository.com for harmonized dataset access\n- ASV team for benchmark infrastructure\n\n## Contact\n\nFor questions or suggestions:\n\n- Open an issue on GitHub\n- Email: <dpysalexander@gmail.com>\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A centralized benchmarking suite to facilitate comparative profiling of tools across graph analytic libraries and datasets",
    "version": "0.1.15",
    "project_urls": null,
    "split_keywords": [
        "networkx",
        " graph",
        " network",
        " benchmarking",
        " profiling"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8d7687b4fea4edfac2085f046cd4cfaea4d224012c4fd7741f9870d6e4357c8",
                "md5": "03666895ada8729a9b5d8bb25cc15293",
                "sha256": "5a7754cc8df8ab2b9ee6d6c27fae4f864659dd29cbce3ff00db45c27b56eba0a"
            },
            "downloads": -1,
            "filename": "nxbench-0.1.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "03666895ada8729a9b5d8bb25cc15293",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 183792,
            "upload_time": "2024-12-16T21:40:26",
            "upload_time_iso_8601": "2024-12-16T21:40:26.282206Z",
            "url": "https://files.pythonhosted.org/packages/b8/d7/687b4fea4edfac2085f046cd4cfaea4d224012c4fd7741f9870d6e4357c8/nxbench-0.1.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b60dff0718454256a3403c4184957d26bb388ca0bdda763ca09482624e398d82",
                "md5": "c9109f89b26039653530069cbead83eb",
                "sha256": "a1f979a6de562d2ddc998ea7dec219d5547e6eae12fd61868097d33db9ca95eb"
            },
            "downloads": -1,
            "filename": "nxbench-0.1.15.tar.gz",
            "has_sig": false,
            "md5_digest": "c9109f89b26039653530069cbead83eb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 180172,
            "upload_time": "2024-12-16T21:40:28",
            "upload_time_iso_8601": "2024-12-16T21:40:28.901926Z",
            "url": "https://files.pythonhosted.org/packages/b6/0d/ff0718454256a3403c4184957d26bb388ca0bdda763ca09482624e398d82/nxbench-0.1.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 21:40:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nxbench"
}
        
Elapsed time: 0.48646s