Learn Before
Example of Benchmarking Implicit Blockers
Benchmarking operations in deep learning frameworks highlights the significant performance costs associated with implicit blockers, such as datatype conversions to synchronous environments. For example, computing a dot product b = np.dot(a, a) and explicitly converting the resulting tensor to a NumPy array via b.asnumpy() acts as an implicit blocker, taking around seconds to execute. Similarly, converting the resulting tensor to a standard Python scalar via b.sum().item() serves as another implicit blocker, taking seconds. These operations are inherently blocking because the synchronous NumPy and Python environments must wait for the actual values to be fully computed by the asynchronous backend before proceeding.
0
1
Tags
D2L
Dive into Deep Learning @ D2L