Add python api for cold warmup parameters#363
Conversation
PR NVIDIA#339 added methods to set/get cold-warmup-runs and cold-max-warmup-walltime to control behavior of warm-up in cold measurements. This change closes NVIDIA#352
6092083 to
aa2f782
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (5)
📝 WalkthroughSummary by CodeRabbit
suggestion: WalkthroughAdds cold-measurement warmup configuration: new Benchmark fluent setters and State getter/setters, bench.option decorators that apply those setters during registration, pybind11 bindings exposing the APIs to Python, and tests/examples validating behavior. ChangesCold warmup configuration API
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
python/test/test_cuda_bench.py (1)
143-187: ⚡ Quick winsuggestion: Add one behavioral assertion path for
bench.option.set_cold_warmup_runs(...)andbench.option.set_cold_max_warmup_walltime(...). The current test verifies only the alias decorators, so a regression in theset_variants could pass unnoticed. As per coding guidelines, "python/**/*: Focus on Python API stability, pybind11/C++ exception boundaries, GIL behavior, CUDA interoperability, object lifetime, package metadata, type stubs, JSON/result parsing compatibility, and tests."
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 61b7c996-cd7c-48d0-9298-b31ec2122ee4
📒 Files selected for processing (5)
python/cuda/bench/__init__.pyipython/cuda/bench/_decorators.pypython/src/py_nvbench.cpppython/test/stubs.pypython/test/test_cuda_bench.py
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
…cold-warmup-parameters
Closes #352
Adds Python API for methods added in #339:
cuda.bench.Benchmark.set_cold_warmup_runs(count : SupportsInt)cuda.bench.Benchmark.set_cold_max_warmup_walltime(duration_seconds : SupportsFloat)cuda.bench.State.get_cold_warmup_runs()cuda.bench.State.set_cold_warmup_runs(count : SupportsInt)cuda.bench.State.get_cold_max_warmup_walltime()cuda.bench.State.set_cold_max_warmup_walltime(duration_seconds : SupportsFloat)Also adds support for setting these through
@cuda.bench.options.cold_warmup_runs(count)and@cuda.bench.options.cold_max_warmup_walltime(seconds).N.B.: This PR is built on top changes from #347 and should be merged after it.