Skip to content

[REQ] Compile adjoint code as-needed, forward code by default #942

@shi-eric

Description

@shi-eric

Description

Currently, Warp relies on a combination of wp.config.enable_backward, module-level "enable_backward", and kernel-level "enable_backward" to decide whether adjoint code should be generated and compiled.

We'd like to explore redesigning this approach to instead compile adjoint kernels on an as-needed basis such as when tape.backward() or wp.launch(..., adjoint=True) is used.

This could result in more compilation overhead for the cases requiring adjoint code, so we will need to measure this impact.

Context

Related to #903, we want to improve the user experience when it comes to compile times. In some projects like Newton, it is not feasible to compile adjoint code for all modules by default, but enabling adjoint code on a per-module basis can also be burdensome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions