Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XPU][TritonIntelGPUToLLVM] Handle arithmetic reductions of i1 values #3113

Merged
merged 7 commits into from
Jan 10, 2025

Conversation

victor-eds
Copy link
Contributor

@victor-eds victor-eds commented Jan 8, 2025

Use logical operations to represent arithmetic reductions of i1 values. Only the SPIR-V builtins being used need to be changed as LLVM will handle the scalar arithmetic operations used.

Closes #3109

Extend `i1` values to `i8` before calling SPIR-V arithmetic group reduction built-ins and truncate back to `i1` afterwards.

Signed-off-by: victor-eds <[email protected]>
@victor-eds victor-eds self-assigned this Jan 8, 2025
@victor-eds victor-eds requested a review from etiotto January 9, 2025 10:31
@victor-eds victor-eds marked this pull request as draft January 9, 2025 12:21
@victor-eds victor-eds marked this pull request as ready for review January 9, 2025 12:25
@victor-eds
Copy link
Contributor Author

@Stonepia I confirm I can run the reproducer in #3109 after this change.

@victor-eds
Copy link
Contributor Author

I'll go with a different approach not needing to extend and using logical operations.

@victor-eds
Copy link
Contributor Author

I found representing as logical operations made more sense as that's what LLVM does for scalar operations and we could generate a bit better code possibly

@victor-eds victor-eds marked this pull request as draft January 9, 2025 14:29
@victor-eds victor-eds marked this pull request as ready for review January 9, 2025 15:42
@whitneywhtsang whitneywhtsang merged commit 66391a3 into main Jan 10, 2025
5 checks passed
@whitneywhtsang whitneywhtsang deleted the arith-i1-reduction branch January 10, 2025 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

undefined reference to `_Z27__spirv_GroupNonUniformIAddiibj'
4 participants