atol and rtol are scalars on a variant entry, read as entry.get("atol", 0) in
test_ktir_examples.py and test_device_launch.py. All 25 uses in the tree are scalars.
That means a dtype sweep cannot carry a tolerance, because tolerance is a property of the
dtype — fp16 ulp at a given magnitude is 8192x fp32's. So a fixture wanting both dtypes must
split into two entries, duplicating summary, tags, kernel_fn, factory, constexpr,
params and the whole tolerance rationale, in order to vary one number.
Concrete instance, from #190: the statistic chain needs 2.5e-1 at fp16 and 3e-5 at fp32.
Both are "16 ulp of the statistic" under one rule — the sqrt(64) reordering prediction
doubled — and expressing that one rule required two entries and two copies of the derivation.
This gets worse as fp32 variants are added across fixtures: every dtype sweep hits it.
Proposed
atol/rtol accept either a scalar (unchanged — the 25 existing uses keep working) or a dict
keyed by dtype, resolved against the variant's own DTYPE from its already-resolved params.
Two properties worth insisting on:
- One resolution site. Both consumers call one helper in
conftest.py. Two copies of a
tolerance rule will drift, and the drift is invisible.
- A dict missing the variant's dtype is an error naming the variant and the dtype, never a
silent default. A silently-zero tolerance makes a test pass or fail for a reason nothing
states.
Spike
Branch fixture-per-dtype-tolerance — one commit on top of #189's branch. Contains the helper,
both call sites, the fixtures/README.md field-table row (which had no rtol/atol row at
all), and one converted consumer in elementwise/meta.py.
It does not include collapsing the statistic-chain entries into one, which depends on
fixtures not present on that base. That part is small and was done once already; it can be
redone when this lands.
Note the spike is verified green as part of a larger branch, but has not been run on #189's base
in isolation — worth doing before merging.
Also fixed by this
Four in-tree comments assert that rtol/atol are fields rather than params (reduce's Level C
and Level D banners, 2d_compute, and elementwise's 2d_spyre_stick_fp32). Those stop being
true.
atolandrtolare scalars on a variant entry, read asentry.get("atol", 0)intest_ktir_examples.pyandtest_device_launch.py. All 25 uses in the tree are scalars.That means a dtype sweep cannot carry a tolerance, because tolerance is a property of the
dtype — fp16 ulp at a given magnitude is 8192x fp32's. So a fixture wanting both dtypes must
split into two entries, duplicating
summary,tags,kernel_fn,factory,constexpr,paramsand the whole tolerance rationale, in order to vary one number.Concrete instance, from #190: the statistic chain needs
2.5e-1at fp16 and3e-5at fp32.Both are "16 ulp of the statistic" under one rule — the
sqrt(64)reordering predictiondoubled — and expressing that one rule required two entries and two copies of the derivation.
This gets worse as fp32 variants are added across fixtures: every dtype sweep hits it.
Proposed
atol/rtolaccept either a scalar (unchanged — the 25 existing uses keep working) or a dictkeyed by dtype, resolved against the variant's own
DTYPEfrom its already-resolved params.Two properties worth insisting on:
conftest.py. Two copies of atolerance rule will drift, and the drift is invisible.
silent default. A silently-zero tolerance makes a test pass or fail for a reason nothing
states.
Spike
Branch
fixture-per-dtype-tolerance— one commit on top of #189's branch. Contains the helper,both call sites, the
fixtures/README.mdfield-table row (which had nortol/atolrow atall), and one converted consumer in
elementwise/meta.py.It does not include collapsing the statistic-chain entries into one, which depends on
fixtures not present on that base. That part is small and was done once already; it can be
redone when this lands.
Note the spike is verified green as part of a larger branch, but has not been run on #189's base
in isolation — worth doing before merging.
Also fixed by this
Four in-tree comments assert that
rtol/atolare fields rather than params (reduce's Level Cand Level D banners,
2d_compute, and elementwise's2d_spyre_stick_fp32). Those stop beingtrue.