flashinfer.cake_causal_conv1d_det_train_kcp.CakeCausalConv1dDetKcpFunction¶
- class flashinfer.cake_causal_conv1d_det_train_kcp.CakeCausalConv1dDetKcpFunction(*args, **kwargs)¶
Autograd wrapper: the forward saves
(x_local, weight)and the history poolhist(no second exchange in the backward); the backward runs the head program, the backward halo exchange and the main backward program.handle: a recompute handle (seeCakeCausalConv1dDetKcpRecomputeHandle): the original forward storeshistin it, the recompute binds it and exchanges nothing; the saved set is the same three tensors either way. A handle is refused with graph replay (keyword or knob) and inside a CUDA-graph capture.cooperative: the main backward program’s launch form (a bool, seecake_causal_conv1d_det_train_kcp_backward()).- __init__(*args, **kwargs)¶
Methods
__init__(*args, **kwargs)applybackward(fn_ctx, grad_y)Define a formula for differentiating the operation with backward mode automatic differentiation.
forward(fn_ctx, x_local, weight, ctx[, ...])Define the forward of the custom autograd Function.
jvp(ctx, *grad_inputs)Define a formula for differentiating the operation with forward mode automatic differentiation.
mark_dirty(*args)Mark given tensors as modified in an in-place operation.
mark_non_differentiable(*args)Mark outputs as non-differentiable.
mark_shared_storage(*pairs)maybe_clear_saved_tensorsnameregister_hookregister_prehooksave_for_backward(*tensors)Save given tensors for a future call to
backward().save_for_forward(*tensors)Save given tensors for a future call to
jvp().set_materialize_grads(value)Set whether to materialize grad tensors.
set_output_grad_dtype(*dtypes)Declare the gradient dtype for each of this Function's outputs.
setup_context(ctx, inputs, output)There are two ways to define the forward pass of an autograd.Function.
vjp(ctx, *grad_outputs)Define a formula for differentiating the operation with backward mode automatic differentiation.
vmap(info, in_dims, *args)Define the behavior for this autograd.Function underneath
torch.vmap().Attributes
boxed_grads_callclear_saved_tensors_on_accessBool that specifies if backward should receive grads as a single mutable list argument instead of individual args in an immutable tuple.
dirty_tensorsgenerate_vmap_rulematerialize_gradsmetadataneeds_input_gradnext_functionsnon_differentiableoutput_grad_dtypesrequires_gradsaved_for_forwardsaved_tensorssaved_variablesto_save