Helper methods for WebGPU runtime #15937
-
Hi, @fs-eire. In the
The motivation is that in the spec, the shape is a tensor input. The idea was to get the new shape from the input tensor and implement
The problem is that during execution, the tensors are located in GPU memory, and the tensor views we are working with are like pointers to them (if my understanding of JSEP is correct). In this case, considering the comment in the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
An alternative for that would be to run the checks inside the WGSL function and raise an error in case of mismatching shapes, but in this case, it is not clear how to get |
Beta Was this translation helpful? Give feedback.
-
I don't add a |
Beta Was this translation helpful? Give feedback.
A1 - it's enforcing the data of input[1] ( which is the shape ) to be on CPU. so the framework ensures that input[1] will be on CPU before executing operator
Reshape
.A2 - I don't fully understand this part. My understanding is that
.Alias(0, 0)
will let ORT to try to make input[0] and output[0] to use the same data. Not sure if that is always same or not. So in code I also write a GPU to GPU copy if they are not same.A3 - yes.