Skip to content

torchsnapshot nightlies / torch nightlies are broken on python < 3.10 #169

@vmoens

Description

@vmoens

🐛 Describe the bug

As part of our CI we incorporate torchsnapshot nightlies tests.
Some signatures require python>3.9 as it appears here

The error reads

  File "/pytorch/rl/env/lib/python3.9/site-packages/torchsnapshot/io_preparers/sharded_tensor.py", line 200, in ShardedTensorIOPreparer
    ) -> Tuple[List[ReadReq], Future[ShardedTensor | torch.Tensor]]:
TypeError: unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'torch._C._TensorMeta'

which occurs because https://github.com/pytorch/torchsnapshot/blob/main/torchsnapshot/io_preparers/sharded_tensor.py misses a

from __future__ import annotations

Versions

torch nightlies, python < 3.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