Skip to content

Checkpoint Function Not Well Tested For Old Pytorch Versions #7265

Closed
@ericspod

Description

@ericspod

Describe the bug
The function torch.utils.checkpoint.checkpoint doesn't have a use_reentrant argument in Pytorch<=1.10. This function is used with this argument in SwinUNETR but tests don't cover the case where using checkpointing is enabled. The tests should be enhanced to account for this, or we drop support for older versions of Pytorch. This is related to an issue in PR #7260.

To Reproduce
Steps to reproduce the behavior:

  1. Create an instance of SwinUNETR with use_checkpoint=True and attempt a forward pass using an older version of Pytorch.

Expected behavior
Forward pass should work as normal.

Environment

Pytorch<=1.10.

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