Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Example] Backward function of RGMS kernel #77

Open
yzh119 opened this issue Dec 10, 2022 · 0 comments
Open

[Example] Backward function of RGMS kernel #77

yzh119 opened this issue Dec 10, 2022 · 0 comments
Assignees

Comments

@yzh119
Copy link
Member

yzh119 commented Dec 10, 2022

The forward function of the RGMS kernel is (relation related information are ignored for simplicity):

$$ Y = AXW $$

we already have its implementation written in SparseTIR using composable formats and tensor cores.

The backward function of the RGMS kernel needs to compute both the gradient of $X$ and $W$ :
$$\nabla (XW) = A^T \nabla Y$$
$$\nabla X = \nabla (XW) W^T $$
$$\nabla W = X^T \nabla (XW) $$

The three formulas could be computed inside the same kernel, and $\nabla (XW)$ should be stored in shared memory. The same optimizations (composable formats + tensorization) could be applied to backward kernel as well.

@yzh119 yzh119 self-assigned this Dec 11, 2022
@yzh119 yzh119 added this to SparseTIR Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant