You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(aorlta): a rewards catalog, and a timing reward where an undecidable measurement is unscored - #615
docs/REWARDS.md: every check adapter and reward function AORLTA ships (parse, compile, reference match, normalised match, timing), what each needs, and its states and reasons. It also says how to write your own while keeping the service's rules: a reward in [-1.55, 1.0], parts base, broke_healthy, length, and an unsettled check that is never clean.
aorlta.reward.timing: judges a candidate's per-launch times against a reference's, taken interleaved on one GPU. faster only past the noise floor (the larger of a minimum and the two relative MADs), not_faster only past it the other way. Noisy, within-noise, too-few or invalid samples are unscored, never clean. A settled verdict carries a measurement record.
rewardfn.speedup: grades a clean reward by the measured speedup, 0.75 to 1.0 when faster by the ratio and below 0.5 when measured and not.
The HIP example gets an optional hipk-speed profile with a ref.speedup leg (hipk.time). It uses the same design as ref.native in feat(aorlta): two worked examples (HIP kernels, Q&A), before/after eval, VALIDATION.md #613: the candidate and the reference are each compiled alone into a device code object, and a harness built from the task alone loads both, checks both outputs, times them interleaved, and writes its result to a record file. None of the candidate's host code runs, and stdout is never read.
Checked on an MI350X node with hip_kernels.py timecheck:
each reference against itself is not_faster at about 1.00 (vector_add, transpose, block_sum);
a candidate whose static initializer prints a fake 10x timing line is measured as itself (not_faster, 1.00);
a deliberately slow candidate is too_slow_to_measure within the default budget, and not_faster at 0.001 with a larger one;
a tiled transpose is 1.07x the naive reference: not_faster at the default ratio of 1.1, and clean at ratio 1.0, in two runs.
…able measurement is unscored
docs/REWARDS.md lists the reward shapes AORLTA supports and what each needs. aorlta.reward.timing judges a candidate's
per-launch times against a reference's, taken interleaved on one GPU: faster only past the noise floor, not_faster only
past it the other way, and noisy, within-noise, too-few or invalid samples unscored, never clean. rewardfn.speedup
grades a clean reward by the measured speedup. The HIP example gets an optional hipk-speed profile with a ref.speedup
leg.
…ds-catalog
#613 now compiles a candidate alone into a device code object and reads the harness's verdict from a record file, so
the timing check is resolved onto the same design rather than linking the candidate's own object into the timing
program (where its static initializers would run and could print a timing line): hipk.time compiles the candidate
and the reference with --genco, the timing harness is built from the task alone and finds the kernel in each code
object by its mangled signature, and the adapter reads only its record file. The symbol-table checks the old design
needed are gone with it, and the timing worker leases its GPU like hipk.run's. REWARDS.md is updated to match.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Incomplete cache identities allow stale timing and reward reuse after code changes, while unresolved relative candidate paths cause valid inputs to fail compilation.
…and the judge; timecheck resolves its paths
- hipk.time's version named the compiler and its own file only, so a changed reference/<id>.hip, or a changed
aorlta.reward.timing, reused cached legs; both are now in it.
- timecheck passed a relative --candidate or --pool through, and the check runs hipcc from a directory of its own;
both are resolved first.
…ing check's version names where it measures
- A timed batch reset the buffers once, so a kernel could skip work its first launch had done (a transpose that writes
only sentinel-valued outputs, say) and be timed as faster. Every launch now runs on buffers reset just before it,
outside its timed interval, and is timed alone.
- A speedup is a fact about one node's GPUs: the version now carries a fingerprint of the host and the gpus setting,
so a run resumed on another node re-measures instead of reusing cached legs (and the reward entries keyed by them).
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Timed launches are never verified, allowing a stateful kernel to pass separate correctness checks while skipping measured work and reporting a false speedup.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Verify outputs after every timed launch
aorlta/examples/hip-kernels/hip_kernels.py:656
Timed launches are never verified, so a kernel with a persistent device counter can pass the separate fresh(0) checks while skipping measured work and earning a clean speedup. With the default 20 launches, computing only on calls congruent to 1 modulo 21 passes every correctness check; buffer resets do not clear device globals. Verify each measured launch's outputs and guards after its stop event and before the next reset, propagate mismatches as unsettled, and add a stateful-kernel regression.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Timed launches lack output validation and retain device-global state, allowing stateful kernels to skip work while passing freshness checks and reporting invalid speedups.
" if (hipEventElapsedTime(&ms, t0, t1) != hipSuccess) return -1.0f;",
" total += ms;",
This branch has not been deployed
No deployments
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
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.
A rewards catalog and a timing reward.
docs/REWARDS.md: every check adapter and reward function AORLTA ships (parse, compile, reference match, normalised match, timing), what each needs, and its states and reasons. It also says how to write your own while keeping the service's rules: a reward in [-1.55, 1.0], partsbase,broke_healthy,length, and an unsettled check that is never clean.aorlta.reward.timing: judges a candidate's per-launch times against a reference's, taken interleaved on one GPU.fasteronly past the noise floor (the larger of a minimum and the two relative MADs),not_fasteronly past it the other way. Noisy, within-noise, too-few or invalid samples are unscored, never clean. A settled verdict carries ameasurementrecord.rewardfn.speedup: grades a clean reward by the measured speedup, 0.75 to 1.0 when faster by the ratio and below 0.5 when measured and not.hipk-speedprofile with aref.speedupleg (hipk.time). It uses the same design asref.nativein feat(aorlta): two worked examples (HIP kernels, Q&A), before/after eval, VALIDATION.md #613: the candidate and the reference are each compiled alone into a device code object, and a harness built from the task alone loads both, checks both outputs, times them interleaved, and writes its result to a record file. None of the candidate's host code runs, and stdout is never read.Checked on an MI350X node with
hip_kernels.py timecheck:not_fasterat about 1.00 (vector_add, transpose, block_sum);not_faster, 1.00);too_slow_to_measurewithin the default budget, andnot_fasterat 0.001 with a larger one;not_fasterat the default ratio of 1.1, andcleanat ratio 1.0, in two runs.Stacked on #613. Draft.