Repository navigation
Conversation
RandomUniform on GPU returned the same values on every infer call: - mark_if_constant folded random_uniform with constant inputs at compile time - seeds were JIT constants and the Philox state never advanced - ShapeOf -> RandomUniform was marked as a shape_of subgraph and skipped when the input shape did not change Exclude random_uniform from constant propagation and shape_of subgraphs, pass seed and Philox state as runtime kernel arguments and advance the state after every execution in the same way as the CPU plugin.
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.
Description of the issue(symptom, root-cause, how it was resolved)
ShapeOf -> RandomUniformis skipped as a shape_of subgraph.The code and line that caused this issue (if it is not changed directly)
program::mark_if_constant()GetJitConstants()(GLOBAL_SEED / OP_SEED as JIT constants)can_mark_node()-> skipped inprimitive_inst::prepare_primitive()Reproduction step and snapshot (if applicable. Do not attach for customer model)
x + RandomUniform([1,50,32], 0, 1)(ortorch.rand/torch.randn_likeconverted to OV), compiled on GPU, 5 infers on one requestProblematic graph
Const(shape), Const(min), Const(max) -> RandomUniform -> Add(x). RandomUniform is removed bypropagate_constants.Parameter -> ShapeOf -> RandomUniform -> .... RandomUniform runs only on the 1st inference.Checklist
random_uniform_gpu_state_test,mark_shape_of_subgraphs.random_uniform_no_marksmoke_RandomUniformInfer,smoke_RandomUniformDynamicInferGPUTestsmoke_BasicRandomUniformandrandom_uniform_gpu_testrun a single inference only, so they cannot catch repeated-call issues. Added state tests inrandom_uniform_gpu_test.cpp, and extendedmark_shape_of_subgraphs_test.cpp.Tickets:
AI Assistance: