Commit Graph

27 Commits

Author SHA1 Message Date
Nader Al Awar
711c1e2eb1 Replace all occurences of pynvbench with cuda-bench 2026-01-29 13:25:17 -06:00
Ashwin Srinath
a681e2185d Add multi-cuda wheel build (#289)
Co-authored-by: Ashwin Srinath <shwina@users.noreply.github.com>
Co-authored-by: Nader Al Awar <naderalawar@gmail.com>
2026-01-28 10:37:55 -05:00
Oleksandr Pavlyk
b5e4b4ba31 cuda.nvbench -> cuda.bench
Per PR review suggestion:
   - `cuda.parallel`    - device-wide algorithms/Thrust
   - `cuda.cooperative` - Cooperative algorithsm/CUB
   - `cuda.bench`       - Benchmarking/NVBench
2025-08-04 13:42:43 -05:00
Oleksandr Pavlyk
d8b0acc8d4 Export exception to nvbench namespace 2025-08-04 12:00:42 -05:00
Oleksandr Pavlyk
73e18419b2 Stub of __cuda_stream__ special method declare tuple[int, int] as return type
This is to indicate that special method always returns a pair of integers
2025-08-04 10:11:33 -05:00
Oleksandr Pavlyk
3fea652d16 Fix type in stub declaration for Benchmark.add_string_axis 2025-08-01 15:03:06 -05:00
Oleksandr Pavlyk
c91204f259 Improved docstrings per PR review suggestions 2025-07-31 15:48:49 -05:00
Oleksandr Pavlyk
add539a0c1 Replaced argument type annotation: int -> typing.SupportsInt
Same for float->typing.SupportsFloat. Result types remain int/float
2025-07-30 16:54:56 -05:00
Oleksandr Pavlyk
9c01f229a6 Add Benchmark set methods, such as set_stopping_criterion, set_timeout, etc
Add
   - State.get_stopping_criterion() -> str
   - Benchmark.set_stopping_criterion(criterion: str) -> Self
   - Benchmark.set_criterion_param_int64(name: str, value: int) -> Self
   - Benchmark.set_criterion_param_float64(name: str, value: float) -> Self
   - Benchmark.set_criterion_param_string(name: str, value: str) -> Self
   - Benchmark.set_timeout(duration: float) -> Self
   - Benchmark.set_skip_time(skip_time: float) -> Self
   - Benchmark.set_throttle_threshold(frac: float) -> Self
   - Benchmark.set_throttle_recovery_delay(duration: float) -> Self
   - Benchmark.set_min_samples(count: int) -> Self
2025-07-30 13:37:17 -05:00
Oleksandr Pavlyk
413c4a114b Support nvbench.State.set_throttle_threshold 2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
b6821b7624 Rename NVBenchRuntimeException to NVBenchRuntimeError
Added exception to __init__.pyi
2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
eb614ac52f Add State.get_axis_values and State.get_axis_values_as_string
Add nvbench.State methods to get Python dictionary representing
axis values of benchmark configuration state represents.

get_axis_values_as_string gives a string of space-separated
name=values pairs.
2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
b9554d7980 Fix method name typo in stub file discovered by mypy 2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
5428534124 Add license header to __init__.py 2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
480614e847 Add license to stub fuile, add comment about syncing impl and stubs
Add comments stating the need to keep implementation and Python stub
file in sync to both files. In the stub file to comment documents
use of mypy's stubgen to generate stubs and calls to compare that against
current stubs. It also calls out the need to keep docstrings and
doctring examples in sync with implementation.
2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
c136efab65 Use absolute imports in cuda/nvbench/__init__.py 2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
361c0337be Use cuda-pathfinder instead of cuda-bindings for Pathfinder
Removed use of __all__ per PR feedback. Emit warnings.warn if
version information could not be retrieved from the package metadata,
e.g., package has been renamed by source code was not updated.
2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
51fa07fab8 Avoid overloading get_int64_or_default as get_int64
Introduce get_int64_or_default method, and counterparts for
float64 and string.

Provided names for Python arguments.

Tried generating Python stubs automatically with

```
stubgen -m cuda.nvbench._nvbench
```

Gave up on this, since it does not include doc-strings.
It would be nice to compare auto-generated _nvbench.pyi with
__init__.pyi for discrepancies though.
2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
dc7f9edfd4 Support nvbench.Benchmark.add_int64_power_of_two_axis 2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
a535a1d173 Fix type annotations in cuda.nvbench, and in examples 2025-07-28 15:37:05 -05:00
Oleksandr Pavlyk
9dba866426 Add State.add_summary method
state.add_summary(column_name: str, value: Union[int, float, str])

This is used in examples/axes.py to map integral value from Int64Axis
to string description.
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
576c473481 Add implementation of and signature for State.getDevice
make batch/sync arguments of State.exec keyword-only

Provide default column_name value for State.addElementCount method,
so that it can be called state.addElementCount(count), or as
state.addElementCount(count, column_name="Descriptive Name")
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
4950a50961 Add empty py.typed to signal mypy that package has type annotations 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
c9f0785aed Replace uses of deprecated typing.Tuple, typing.Callable, etc.
Also use typing.Self to encode that `Benchmark.addInt64Axis` returns
self.
2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
e768ce28b6 Add Python stub file for cuda.nvbench API 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
c184549cda Import and reexport symbols from _nvbench one-by-one 2025-07-28 15:37:04 -05:00
Oleksandr Pavlyk
6552ef503c Draft of Python API for NVBench
The prototype is based on pybind11 to minimize boiler-plate
code needed to deal with move-only semantics of many nvbench
classes.
2025-07-28 15:37:04 -05:00