Should we add $\alpha$ and $\beta$ to Op interfaces? #1435
Replies: 1 comment
-
In the interface we've historically exposed, there isn't a kernel that preserves the existing weights? So that'd be a new generalization? That being said, I'd be open to making I agree with you that restriction to a compile-time scalar constant (so an attribute) makes sense. As for implementation, I see the following cases
Or, in other words, this is a reasonable generalization we could do. However, on the interface note: For the current case, what we want - since we can't send back a zero-init kernel - is to tell MIGraphX we want that initilalization step. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
As far as I understood, we have the GEMM interface defined as$C = A \cdot B$ plus some attributes. There is an ambiguous situation arising from the $C$ . However, we also convert $C$ must be preserved.
Split-K
. WhenSplit-K
is used, one need to useatomicAdd
as the store method. In general, it demands zero-initialization of matrixConv
operations to GEMMs and, sometimes (e.g., weights updates during the back propagation), the content of matrixWe can solve this problem by adding some additional (probably optional) Boolean attribute which the user should provide to tell us whether the original content of$C$ must be re-written or taken into account.
However, this problem can be solved generically if we stick to the BLAS interface - i.e.,$C = \alpha A \cdot B + \beta C$ . We can probably do the same with conv. ops. - i.e., $Out = \alpha ( Img \otimes Kernel) + \beta ( Out )$ .
In our case, we can demand that$\alpha$ and $\beta$ must be compile-time constants.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions