Skip to content

Add ARM64 SIMD support for sparse CPU math #7740

Description

@matouskozak

Is your feature request related to a problem? Please describe.
CpuMathUtils.DotProductSparse and indexed AddScale currently use scalar loops on ARM64. Their optimized paths depend on SSE/AVX. These operations are used in sparse L-BFGS training and linear-model prediction.

Describe the solution you'd like
Investigate ARM64 SIMD implementations for these two operations. Preserve the existing x86 paths and scalar fallback. Enable the new paths only where benchmarks show a benefit.

Validation should cover:

  • Different stored-entry counts and index layouts, including short inputs and scalar tails.
  • Correctness against scalar reference results, with hardware intrinsics enabled and disabled.
  • L-BFGS training, model save/load, and prediction.

Describe alternatives you've considered
Retain scalar loops where SIMD does not improve performance, especially for short inputs. Dense TensorPrimitives operations are not a direct replacement for indexed sparse math.

Additional context
Related: #6875 migrated dense operations to TensorPrimitives but left these sparse operations unchanged.

Relevant source: DotProductSparse and indexed AddScale.

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

    area-CoreCore ML.NET APIs and shared functionalityenhancementNew feature or requesttenet-performancePerformance related issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions