Skip to content

Performance discrepancy with nan coordinates vs coordinates=None #294

@jsjung00

Description

@jsjung00

There is an interesting performance discrepancy when passing in null coordinates (tensor full of nans) versus coordinates = None.
Passing in null coordinates has significantly worse performance. By default, torch.inf padded tokens are added to the coordinates, whereas with coordinates = None the coordinates become a tensor consisting only of nans.

To produce discrepancy:

    ptms = [] 
    for _ in range(30):
        seq_cfg = GenerationConfig(track="sequence", num_steps=8)
        struct_cfg = GenerationConfig(track="structure", num_steps=8)
        #seq = model.generate(ESMProtein(sequence='_'*256, coordinates=None), seq_cfg)
        seq = model.generate(ESMProtein(sequence='_'*256, coordinates=torch.full((256, 3, 3), float("nan"), dtype=torch.float, device='cuda')), seq_cfg)
        structure = model.generate(seq, struct_cfg)
        ptms.append(structure.ptm.item())
    print(np.mean(ptms))

Coordinates=None: Mean pTM 0.4264
Coordinates=Nans: Mean pTM : 0.09578

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions