Skip to content

Incorrect results when using MPS backend (MacOS) #33

@JAEarly

Description

@JAEarly

TS2Vec uses the GELU activation function. Unfortunately, there's currently a bug in PyTorch for the GELU activation function on MPS devices (since April 2023).

This won't throw an error, just leads to rubbish results in both training and inference.

Hopefully this will be patched by PyTorch, but in the meantime a work around is to change F.gelu(x) to F.gelu(x.contiguous()) on lines 34 and 36 of models/dilated_conv.py . Results are then as expected.

I won't bother with a PR as I assume this will be patched by PyTorch in the (near) future.

More info:
pytorch/pytorch#98212
huggingface/transformers#22468

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions