[Feature] Extract reusable event-based benchmarking helper#829
Draft
jhinpan wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Jin Pan <jpan236@wisc.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract the existing GPU event benchmark helper from
flydsl.autotuneinto the reusableflydsl.profilingmodule.This is intentionally a narrow, non-intrusive first slice of #304. It does not move the broader
tests/test_common.pyutilities or change any kernel, compiler, or backend implementation.Motivation
FlyDSL already has a small event-based
do_benchimplementation, but it is nested inside the autotune module. Moving it to a shared package-level module lets other profiling and benchmarking callers reuse the same behavior and gives the autotune path in #770 a clearer dependency boundary.The module does not import ROCDL, NVVM, or FlyDSL compiler bindings. Its current runtime implementation lazily uses PyTorch’s
torch.cudaevent interface, which PyTorch also exposes on HIP builds.This PR does not implement or claim validation of a FlyDSL NVVM backend. Runtime/backend placement for the future dual-backend direction remains related to #813; the focused namespace question is recorded on #304.
Changes
flydsl.profiling.do_bench.setuphook introduced in autotune [2/5] autotune: add opt-in search and RMSNorm waves-per-EU tuning (#770) #785, running it before each warmup and timed iteration but before the start event so restore/reset work is excluded from kernel latency.flydsl.autotune.do_benchas a compatibility alias.Compatibility is preserved for existing autotune callers: the import path, valid call signature, defaults, and result shape remain unchanged.
Performance
Not applicable. This is a direct extraction of the existing timer and does not change generated kernels or compiler behavior.
A live MI350X/HIP smoke test returned a valid event-based median timing.
Testing
GPU-free profiling and existing autotune unit tests:
PYTHONPATH="$PWD/python${PYTHONPATH:+:$PYTHONPATH}" \ python3 -m pytest tests/unit/test_profiling.py tests/unit/test_autotune.py -qResult:
31 passed.Repository Python style gate (
bash scripts/check_python_style.sh --include-local).Targeted Black and Ruff checks for all changed Python files.
MI350X/HIP event-timing smoke test.
CUDA/NVVM execution was not tested and is not claimed by this PR.
Dependencies
Breaking Changes
None for valid existing calls.
flydsl.autotune.do_benchremains available as an alias to the shared implementation.Refs #304, #770, #813.