fpmath_mode, accumulation_mode, scratchpad_mode and deterministic modes are not encoded as part of the key for the PD cache. This can cause subsequent creations of a primitive to ignore changes to these modes ( e.g. during unit tests ).
In particular changing fpmath_mode between subsequent, calls to otherwise identical matmul has no effect since the pd is loaded from cache from previous call.
Using ONEDNN_VERBOSE we could see that the primitive descriptor is loaded from cache and toggling the fpmath mode on/off between subsequent calls didn't have an effect. This code should resolve that issue and other computation modes are added here ( deterministic, scratchpad and accumulation ) to ensure consistency.
fpmath_mode, accumulation_mode, scratchpad_mode and deterministic modes are not encoded as part of the key for the PD cache. This can cause subsequent creations of a primitive to ignore changes to these modes ( e.g. during unit tests ).
In particular changing fpmath_mode between subsequent, calls to otherwise identical matmul has no effect since the pd is loaded from cache from previous call.
Using ONEDNN_VERBOSE we could see that the primitive descriptor is loaded from cache and toggling the fpmath mode on/off between subsequent calls didn't have an effect. This code should resolve that issue and other computation modes are added here ( deterministic, scratchpad and accumulation ) to ensure consistency.