-
Notifications
You must be signed in to change notification settings - Fork 204
[Types] Add float16 (Half) support #568
Copy link
Copy link
Open
Labels
coreInternal engine: Shape, Storage, TensorEngine, iteratorsInternal engine: Shape, Storage, TensorEngine, iteratorsdocumentation-neededFeature requires documentation after implementation or depiction of lack of documentationFeature requires documentation after implementation or depiction of lack of documentationenhancementNew feature or requestNew feature or requestmissing feature/sNumPy function not yet implemented in NumSharpNumPy function not yet implemented in NumSharp
Milestone
Metadata
Metadata
Assignees
Labels
coreInternal engine: Shape, Storage, TensorEngine, iteratorsInternal engine: Shape, Storage, TensorEngine, iteratorsdocumentation-neededFeature requires documentation after implementation or depiction of lack of documentationFeature requires documentation after implementation or depiction of lack of documentationenhancementNew feature or requestNew feature or requestmissing feature/sNumPy function not yet implemented in NumSharpNumPy function not yet implemented in NumSharp
Overview
Add support for
float16(C#System.Half) type to NumSharp. This is a high-priority missing type critical for modern ML workloads.Problem
NumSharp is missing
float16(half-precision floating point):Critical use cases:
.npymodel weights are fp16Proposal
Task List
NPTypeCode.Float16 = 16toNPTypeCode.csnp.float16type alias innp.csNPTypeCodeExtensions.GetTypeCode()to handletypeof(Half)InfoOf<T>forHalfUnmanagedStoragetype switchesArraySliceallocation for Half_typemap_arr_arrand_typemap_arr_scalarinnp.find_common_type.cs.npyfiles from ML modelsC# Type Mapping
.NET Half Support
.NET
System.Halfhas full arithmetic and math function support built-in.Implementation Effort
LOW — System.Half is a built-in .NET type since .NET 5 with full arithmetic support.
Estimated: ~50-100 lines of changes across multiple files.
Related
References