@triton.jit
def mlstm_matmul_kernel_df(dF, F, NH: tl.constexpr, S: tl.constexpr):
    bh_id = tl.program_id(0)
    batch_id = bh_id // NH
    head_id = bh_id % NH
    batch_offset_f = batch_id * NH * S + head_id * S
    offset_f = tl.arange(0, S)
    df = tl.load(dF + batch_offset_f + offset_f, offset_f < S)
    df = tl.associative_scan(df, 0, scan_add_op)
    f = tl.load(F + batch_offset_f + offset_f, offset_f < S)
    df = tl.sigmoid(-f) * df
    tl.store(dF + batch_offset_f + offset_f, df, offset_f < S)
