Skip to content

ARM fp16 arithmetic produces all-NaN output for a ViT-tiny graph / model (ncnn 20260526) #6932

Description

@cesarpgouveia

On arm64-v8a, setting use_fp16_arithmetic = true makes a ViT-tiny (patch16, 224×224, 256-d output) return 256/256 non-finite values. use_fp16_storage and fp32 are numerically clean on the identical setup (cosine ≥0.9994 vs the ONNX reference).

Environment: ncnn 20260526, arm64-v8a static build, Samsung Galaxy A35 (Exynos 1380, Cortex-A78+A55, asimdhp present, no i8mm), Android 14.

Repro: load the model from file into a raw ncnn::Net, single-threaded, no app framework; set opt.use_fp16_arithmetic = true; run one 1×3×224×224 float input. Output blob is entirely NaN. Set it to false → correct output.

The model was converted from ONNX with pnnx. x86 is unaffected. Happy to provide a reproducing .param/.bin if useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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