Add type-aware extrema and integer ceil-division APIs [wip] - #995
Open
Phil-amd wants to merge 3 commits into
Open
Add type-aware extrema and integer ceil-division APIs [wip]#995Phil-amd wants to merge 3 commits into
Phil-amd wants to merge 3 commits into
Conversation
Provide direct signed, unsigned, and floating-point lowering so kernels can avoid raw arithmetic without changing edge-case semantics.
Route tested extrema and runtime ceiling division through the public typed APIs while preserving generated code for reduction kernels.
Align authoring guidance with the new semantics and reject newly introduced raw extrema or ceil-division spellings in kernel diffs.
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
fx.max(),fx.min(), andfx.ceildiv()exports with per-type lowering (float →maximumf/minimumf, signed int →maxsi/minsi/ceildivsi, unsigned int →maxui/minui/ceildivui) and compile-time folding where host semantics match.pa_metadata, sharedcdivhelper) to the new typed APIs; mechanical extrema migrations produce byte-identical normalized IR and final ISA.scripts/check_typed_arithmetic_usage.py), and update authoring docs/skills to steer away from deprecated method-form extrema and raw MLIR builders.Closes #994. Child of #934.
Test plan
pytest tests/unit/test_typed_arith_ops.py tests/unit/test_typed_arithmetic_guard.pytest_kernel_known_block_size.pyand multi-GPU tests)