Skip to content

LayerNorm_A calculation precision is unstable, leading to incorrect recognition results. #42

@winf

Description

@winf

#41 #20
When using models other than .en, if the model size exceeds ‘tiny’, the recognition results are found to be significantly incorrect. By comparing the layer-by-layer outcomes with the openai repository’s runtime results, it was ultimately determined that the source of the problem is the poor stability of mean and variance calculations in the LayerNorm_A function. I fixed the issue by replacing fp16 with fp32. Reference: https://git.bwbot.org/publish/useful-transformers/-/blob/main/lib/layernorm.cc

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