You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So elaborating on what you said, we are looking to create a mapping of (id, promise) inside pub struct GPUDevice, then we can use this map in fn CreateComputePipelineAsync to store the promise and pipeline id, once the mapping is done, we can send a async request to the server along with the pipeline id to create the compute pipeline.
Then when the server responds the fn handle_server_msg comes into play, where we can have a new variant WebGPUOpResult::PipelineCreationResult to handle results related to async pipeline creation, where the mapping and pipeline id is used to retrieve the promise and then it is either resolved or rejected. Is this what is expected?
#31194 is now testing field for #31397, it's actually finished but it also includes CTS refresh and expectation stabilization (which actually works pretty well except for webgpu:shader,execution,expression tests that are still flaky).
Maybe it would make sense to land it just for partial CTS stabilization @gterzian?
@anamansari062 I think this one is doable as a first issue. Does the above description feel like it is giving you enough information? If not, I would look for an issue with a B-newcomer tag.
@anamansari062 (also @sandeepB3 , sorry I missed your earleir message) I had another look and I think this is not a good first issue, because the GPUDevice is not plugged-in yet into the IPC messaging using AsyncWGPUListener, which I thought it was via the handle_server_msg method(but it seems that method is only used to synchronously report errors, for example here).
Also, doing this would require more than just storing the promise and later resolving it: it would likely also require storing additional info, and also making changes to the backend component at component/webgpu to send back additional info in the response message. What "additional info" means would require some looking into, I would say at least the "pipeline id" to match a given pending promise resolution pipeline to an incoming response to be handled. That additional data would then have to be part of the response, probably via a nested enum at WebGPUOpResult.
So in other words, this would be quite a little project requiring some research and taking additional decisions based on what one finds.
Ah, I think I got it, non async versions just returns pipeline objects (and in parallel runs actual creation in wgpu thread), async versions should just await for the creation to finish and then resolve promise, based on that. There is no need to store promise in device struct as this is abstracted via response_async that we should use. I will probably deal with it with new passes changes.
Activity
gterzian commentedon Mar 8, 2024
cc @sagudev
sandeepB3 commentedon Mar 8, 2024
Hey @gterzian, can I give this issue a try?
So elaborating on what you said, we are looking to create a mapping of
(id, promise)insidepub struct GPUDevice, then we can use this map infn CreateComputePipelineAsyncto store thepromiseandpipeline id, once the mapping is done, we can send a async request to the server along with thepipeline idto create the compute pipeline.Then when the server responds the
fn handle_server_msgcomes into play, where we can have a new variantWebGPUOpResult::PipelineCreationResultto handle results related to async pipeline creation, where themapping and pipeline idis used to retrieve the promise and then it is either resolved or rejected. Is this what is expected?sandeepB3 commentedon Mar 11, 2024
Hey @sagudev, are you still working on this draft: #31194 ?
sagudev commentedon Mar 11, 2024
#31194 is now testing field for #31397, it's actually finished but it also includes CTS refresh and expectation stabilization (which actually works pretty well except for
webgpu:shader,execution,expressiontests that are still flaky).Maybe it would make sense to land it just for partial CTS stabilization @gterzian?
gterzian commentedon Mar 11, 2024
Which PR do you mean? If you mean #31194 yes I think it's a good idea, also because it makes it possible to start working on this issue.
anamansari062 commentedon Mar 30, 2024
@gterzian Can I work on this issue?
gterzian commentedon Apr 1, 2024
@anamansari062 I think this one is doable as a first issue. Does the above description feel like it is giving you enough information? If not, I would look for an issue with a
B-newcomertag.anamansari062 commentedon Apr 1, 2024
@gterzian It is doable. I have one question: what do you mean by store the promise?
a. Store it in struct
GPUDeviceb. Create a new struct for it
gterzian commentedon Apr 2, 2024
@anamansari062 (also @sandeepB3 , sorry I missed your earleir message) I had another look and I think this is not a good first issue, because the
GPUDeviceis not plugged-in yet into the IPC messaging usingAsyncWGPUListener, which I thought it was via thehandle_server_msgmethod(but it seems that method is only used to synchronously report errors, for example here).Also, doing this would require more than just storing the promise and later resolving it: it would likely also require storing additional info, and also making changes to the backend component at
component/webgputo send back additional info in the response message. What "additional info" means would require some looking into, I would say at least the "pipeline id" to match a given pending promise resolution pipeline to an incoming response to be handled. That additional data would then have to be part of the response, probably via a nested enum atWebGPUOpResult.So in other words, this would be quite a little project requiring some research and taking additional decisions based on what one finds.
sagudev commentedon Jun 20, 2024
Ah, I think I got it, non async versions just returns pipeline objects (and in parallel runs actual creation in wgpu thread), async versions should just await for the creation to finish and then resolve promise, based on that. There is no need to store promise in device struct as this is abstracted via
response_asyncthat we should use. I will probably deal with it with new passes changes.