Low overhead
Due to the nature of the CPU backend, there is no additional overhead to save and load the tensor data. All the data in the tensors exist in the memory of the JavaScript runtime. The underlying data can be quickly accessed with a few CPU cycles. The main memory that's connected to the CPU is the fastest resource that's universally available.
The benefit of the low overhead of using a CPU backend emerges when the size of the tensor is relatively small. For extensive data, the impact of the overhead of copying and loading the data between specific hardware or remote resources can be ignored compared to the performance gain of acceleration. But for smaller data, the overhead is a dominant factor of the whole performance measurement. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access