llama.cpp
0eebb6ed - ggml : implement the backward pass for TRI (#30712)

Commit
22 days ago
ggml : implement the backward pass for TRI (#30712) * ggml: implement the backward pass for TRI GGML_OP_TRI had no case in the backward switch, so a trainable graph containing it aborted with "unsupported ggml op for backward pass: TRI". The op is linear, so its gradient is masked the same way. The incoming gradient is not necessarily contiguous (the backward of a transpose hands over a view) and ggml_tri requires contiguity, so it is made contiguous first. test_tri gains a post_transpose variant (out = transpose(tri(a))) that aborts as above without this change. * ggml : simplify the TRI backward pass Pass the gradient directly to ggml_tri and drop the transpose test. The existing TRI cases cover the backward pass for contiguous F32 gradients.
Author
Parents
Loading