Implemention of philox key fold in tensor - #5451
Draft
orrangetabby17 wants to merge 3 commits into
Draft
orrangetabby17 wants to merge 3 commits into
orrangetabby17 wants to merge 3 commits into
Conversation
Port the graph-safe tensor-data overload of _philox_key_fold_in to XPU, following the CUDA implementation in aten/src/ATen/native/cuda/PhiloxKeySplit.cu. The data value is read from device memory at kernel execution time instead of being baked into the launch. The scalar kernel body is factored into a shared inline helper so both variants fold keys identically. (cherry picked from commit 9858ab5)
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.
Resolves #4062
Summary
This PR adds XPU implementation for
_philox_key_fold_in.Tensorwhich is the tensor overload of_philox_key_fold_in.The implementation also reused the Philox fold-in logic into a shared helper so that the scalar and tensor variants use the same key folding logic.
Add input validation for shape, dtype, device, and number of elements.