Skip to content

Functorch support: RuntimeError: In order to use an autograd.Function with functorch transforms #7323

Open
@ifiaposto

Description

@ifiaposto

Hi,

Are you planning to support functorch? I am currently getting:

[rank2]: File "/home/iapostol/miniconda3/envs/scaff/lib/python3.12/site-packages/deepspeed/runtime/zero/linear.py", line 109, in zero3_linear_wrap
[rank2]: return LinearFunctionForZeroStage3.apply(input, weight)
[rank2]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[rank2]: File "/home/iapostol/miniconda3/envs/scaff/lib/python3.12/site-packages/torch/autograd/function.py", line 577, in apply
[rank2]: raise RuntimeError(
[rank2]: RuntimeError: In order to use an autograd.Function with functorch transforms (vmap, grad, jvp, jacrev, ...), it must override the setup_context staticmethod. For more details, please see https://pytorch.org/docs/main/notes/extending.func.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions