Comprehensive Benchmark for PyTorch backend

Open
#52 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ninjaduck7 is already working on this.

Since Aug 15, 2026.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet

Research direction

Start by reading the existing JIT support work in issue #4 and locating the repository’s existing benchmark entry points. Build representative, parameterized benchmarks for Circuit, DMCircuit, MPScircuit, AD, and VMAP, then run them across the three backends on CPU and GPU. Done means the suite records compilation and execution times and produces a reproducible comparison report; the issue does not name specific files or tests.

Written by the indexing model from the issue text.

Description

good first issue

Description

With the PyTorch backend now supporting jit (see issue #4), it is crucial to establish a comprehensive benchmark suite. This suite will be used to evaluate and compare the performance of the PyTorch backend agaisnt TensorFlow, and JAX backends across different hardware environments.

The goal is to measure and analyze both compilation and execution times for a variety of representative workloads, as these can vary significantly depending on the problem size, ML backend, and hardware (CPU vs. GPU).

Tasks

1. Benchmark Suite Development
  • Develop a suite of benchmarks for the following components:
    • Circuit
    • DMCircuit
    • MPScircuit
    • AD
    • VMAP
    • all with jit
  • Ensure benchmarks are sufficiently large to yield meaningful and stable performance measurements, cotengra contractor is often required for consistent performance.
  • Parameterize benchmarks to allow for scaling of problem size.
2. Backend and Hardware Testing Matrix
  • Configure the benchmark runner to execute across the following configurations:
    • Backends:
      • PyTorch
      • TensorFlow
      • JAX
    • Hardware:
      • CPU
      • GPU
3. Reporting and Analysis
  • Log and report both compilation time and execution time for each test case.
  • Analyze the results to identify performance bottlenecks and areas for optimization for each backend.

Acceptance Criteria

  • A set of benchmark scripts are created and added potentially to the repository.
  • The benchmarks can be executed against all three backends (PyTorch, TensorFlow, JAX) and both devices.
  • A clear and reproducible report of the results is generated, comparing the performance of the different backends.

Additional Context

This benchmark suite will be a critical tool for ongoing performance monitoring and will help guide future development and optimization efforts. It will also provide valuable information to users, helping them choose the best backend for their specific use cases and hardware.

Dominant language
Python
Stars
92
Forks
25
Avg merge
21h 12m
Merged PRs (30d)
57

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tensorcircuit/tensorcircuit-ng

All issues in tensorcircuit/tensorcircuit-ng

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.