Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Outline

PhysicsNeMo Benchmarks with ASV

This directory contains ASV-based benchmarks for PhysicsNeMo. Benchmarks are discovered from the benchmarks/ tree and configured via asv.conf.json in the repository root.

Resources:

Running a benchmark

Run all benchmarks from the repo root:

./benchmarks/run_benchmarks.sh

Note: the first run may take a while because ASV builds its virtual environment.

Run a subset by name or regex:

./benchmarks/run_benchmarks.sh -b knn

Publishing and viewing results

Publish results to the local HTML report:

asv publish

Preview the report in a local web server:

asv preview

The generated site is written to .asv/html/ (open index.html if you prefer).

Adding a new benchmark

  1. Add a new file under benchmarks/ following the package structure (for example, benchmarks/physicsnemo/nn/neighbors/my_benchmark.py).
  2. Define a benchmark class and at least one time_* method. See documentation for available benchmark types.
  3. Use setup() to create inputs and keep benchmarks deterministic. See documentation for available benchmark attributes.

Example:

import torch


class MyOpBenchmark:
    params = [1024, 4096]
    param_names = ["n"]

    def setup(self, n: int) -> None:
        self.x = torch.randn(n, n, device="cuda")

    def time_my_op(self, n: int) -> None:
        _ = self.x @ self.x
        torch.cuda.synchronize()
Morty Proxy This is a proxified and sanitized view of the page, visit original site.