Cargo Features

[dependencies]
torsh-benches = { version = "0.1.0", default-features = false, features = ["std", "compare-external", "pytorch", "tensorflow", "jax", "numpy_baseline", "profiling", "gpu", "autograd"] }
default = std

The std feature is set by default whenever torsh-benches is added without default-features = false somewhere in the dependency tree.

std default
compare-external

Enable comparisons with other libraries

Affects ndarray_comparisons::NdarrayMatmulBench, ndarray_comparisons::NdarrayElementwiseBench, ndarray_comparisons::NdarrayMatmulBench, ndarray_comparisons::NdarrayElementwiseBench

pytorch = numpy, pyo3

Enable PyTorch comparisons via Python

Affects pytorch_comparisons::PyTorchMatmulBench, pytorch_comparisons::PyTorchElementwiseBench, pytorch_comparisons::PyTorchConvBench, pytorch_comparisons::PyTorchAutogradBench, pytorch_comparisons::PyTorchDataLoaderBench, pytorch_comparisons::run_pytorch_comparison_benchmarks, pytorch_comparisons::run_comprehensive_pytorch_benchmarks, pytorch_comparisons::run_quick_pytorch_comparison, torsh-benches::pytorch_comparisons, pytorch_comparisons::PyTorchMatmulBench, pytorch_comparisons::PyTorchElementwiseBench, pytorch_comparisons::PyTorchConvBench, pytorch_comparisons::PyTorchAutogradBench, pytorch_comparisons::PyTorchDataLoaderBench, pytorch_comparisons::run_pytorch_comparison_benchmarks, pytorch_comparisons::run_comprehensive_pytorch_benchmarks, pytorch_comparisons::run_quick_pytorch_comparison

tensorflow = numpy, pyo3

Enable TensorFlow comparisons via Python

Affects tensorflow_comparisons::TensorFlowBenchRunner, tensorflow_comparisons::TorshVsTensorFlowMatmul, tensorflow_comparisons::TorshVsTensorFlowElementwise, tensorflow_comparisons::TorshVsTensorFlowConv2d, tensorflow_comparisons::run_tensorflow_comparison_suite, tensorflow_comparisons::generate_tensorflow_comparison_report, torsh-benches::tensorflow_comparisons

jax = numpy, pyo3

Enable JAX comparisons via Python

Affects jax_comparisons::JAXBenchRunner, torsh-benches::jax_comparisons

numpy_baseline = numpy, pyo3

Enable NumPy baseline comparisons via Python

Affects torsh-benches::numpy_comparisons, numpy_comparisons::NumPyBenchRunner, numpy_comparisons::TorshVsNumPyMatmul, numpy_comparisons::TorshVsNumPyElementwise, numpy_comparisons::run_numpy_comparison_suite, numpy_comparisons::generate_numpy_comparison_report

profiling

Additional features for conditional compilation
Enable profiling features

gpu

Enable GPU benchmarking features

autograd

Enable autograd-specific benchmarks

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

pyo3 jax? numpy_baseline? pytorch? tensorflow?

Enables pyo3 ^0.27

✅ SciRS2 Policy: Use scirs2_core::benchmarking for all benchmark data generation

PyTorch comparisons (via Python bindings)
For embedding Python (calling Python from Rust), we need auto-initialize feature

numpy jax? numpy_baseline? pytorch? tensorflow?

Enables numpy ^0.27