During reviewing the CL, Andrew (amoylan@chromium.org) proposed an interesting point: for the values of DevicePreference should we extend "GPU" to "GpuRequired" and "GpuPreferred"? The reason is that, in an ML model there may be some OPs that can not be supported on GPU. Then the backend has three choices,
- Fail it and returns an "unsupported" error.
- Run the model totally on CPU (fallback to CPU).
- Run the supported OPs on GPU and the other OPs on CPU (partially fallback to CPU).
Currently, we only have one value "gpu" so it is hard to tell which case above is most appropriate. After we have "GpuRequired" and "GpuPreferred", we can,
- If the preference is "GpuRequired", then go with 1.
- If the preference is "GpuPreferred", then go with 3.
Of course, there may be potential fingerprinting issue that the web client can directly know which OPs the user's GPU can/can't suppport.
During reviewing the CL, Andrew (amoylan@chromium.org) proposed an interesting point: for the values of
DevicePreferenceshould we extend "GPU" to "GpuRequired" and "GpuPreferred"? The reason is that, in an ML model there may be some OPs that can not be supported on GPU. Then the backend has three choices,Currently, we only have one value "gpu" so it is hard to tell which case above is most appropriate. After we have "GpuRequired" and "GpuPreferred", we can,
Of course, there may be potential fingerprinting issue that the web client can directly know which OPs the user's GPU can/can't suppport.