Refactor: Move fundamental data type headers to core/common (#26330)
Move `endian.h`, `float16.h`, and `float8.h` from `core/framework/` to
`core/common/` to avoid circular dependencies and improve architectural
layering.
## Motivation
These headers define fundamental data types that are used across
multiple low-level libraries:
- `onnxruntime_common` (foundation layer)
- `onnxruntime_mlas` (math library, depends on common)
- `onnxruntime_util` (utilities, depends on common)
- `onnxruntime_graph` (graph IR, depends on common)
Previously, these types were in `core/framework/`, which is part of the
`onnxruntime_framework` library that sits at a higher architectural
level. This created circular dependency issues since mlas uses the
"float16.h" .
## Changes
### File Moves (3 files):
- `include/onnxruntime/core/framework/endian.h` →
`include/onnxruntime/core/common/endian.h`
- `include/onnxruntime/core/framework/float16.h` →
`include/onnxruntime/core/common/float16.h`
- `include/onnxruntime/core/framework/float8.h` →
`include/onnxruntime/core/common/float8.h`
### Include Path Updates (53 files):
Updated all references from:
- `core/framework/endian.h` → `core/common/endian.h`
- `core/framework/float16.h` → `core/common/float16.h`
- `core/framework/float8.h` → `core/common/float8.h`
Affected components:
- Contrib ops (CPU, CUDA, ROCm)
- Core framework and utilities
- Providers (CPU, CUDA, CANN, QNN, OpenVINO, MIGraphX)
- Tests
- Training code
## Architectural Benefits
This change establishes clearer architectural boundaries:
```
Level 0 (Foundation):
onnxruntime_common (includes endian, float16, float8)
onnxruntime_mlas → depends on common
Level 1 (Core):
onnxruntime_util → depends on common
onnxruntime_graph → depends on common
Level 2 (Framework):
onnxruntime_framework → depends on common
```
By placing fundamental types in `common`, we ensure:
1. No circular dependencies between library targets
2. Lower-level libraries can access these types without pulling in
framework
3. Clear separation between fundamental types (common) and
framework-specific types like int4, float4 (framework)
This PR is split from #26317 as suggested by the reviewer.