Skip to content

CPU execution fails due to unconditional use of torch.amp.autocast #1

@orangeSi

Description

@orangeSi

Hi Profluent team,

Thank you for open-sourcing Protein2PAM — it is a very useful and well-designed tool.

I encountered an issue when running Protein2PAM in a CPU-only environment. The program crashes with the following error:

RuntimeError: Currently, AutocastCPU only support Bfloat16 as the autocast_cpu_dtype

This happens because torch.amp.autocast is always enabled in oracle.evaluate(), even when device_type == "cpu". However, PyTorch CPU autocast only supports bfloat16, while the current implementation uses float32 (or an incompatible default), which leads to this runtime error.

Thank you very much for your work and for maintaining this repository!

Best regards,
Si

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