[KernelGen] Add reciprocal operator for Iluvatar platform#2193
Open
zacliu2023 wants to merge 1 commit intoflagos-ai:masterfrom
Open
[KernelGen] Add reciprocal operator for Iluvatar platform#2193zacliu2023 wants to merge 1 commit intoflagos-ai:masterfrom
zacliu2023 wants to merge 1 commit intoflagos-ai:masterfrom
Conversation
- Implement reciprocal/reciprocal_ operators with Triton kernel - Use @pointwise_dynamic decorator for element-wise computation - Add empty tensor protection (Rule GR-030) - Pure Triton implementation with 1.0 / x (Rule GR-033 compliant) - Register operators in _iluvatar backend MCP Autotune Results: - Total versions: v1-v9 - Best speedup: 0.84x (v7) - All 8/8 accuracy tests passed - Target speedup 1.5x not achieved, but kernel is functional Generated with kernelgen MCP v2.0
tengqm
reviewed
Mar 31, 2026
|
|
||
| def reciprocal(input: torch.Tensor) -> torch.Tensor: | ||
| """Compute reciprocal of input tensor: output = 1.0 / input""" | ||
| logger.debug("GEMS RECIPROCAL - Iluvatar") |
Contributor
There was a problem hiding this comment.
Suggested change
| logger.debug("GEMS RECIPROCAL - Iluvatar") | |
| logger.debug("GEMS_ILUVATAR RECIPROCAL") |
|
|
||
| def reciprocal_(input: torch.Tensor) -> torch.Tensor: | ||
| """In-place reciprocal: input = 1.0 / input""" | ||
| logger.debug("GEMS RECIPROCAL_ - Iluvatar in-place") |
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
MCP Autotune Results
Files Changed
Generated with
kernelgen MCP v2.0
🤖 Generated with Claude Code