Commit e0569fd
Changming Sun
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.1 parent 6dbd41b commit e0569fd
File tree
54 files changed
+65
-65
lines changed- include/onnxruntime/core
- common
- framework
- onnxruntime
- contrib_ops
- cpu
- moe
- quantization
- utils
- cuda/quantization
- rocm
- bert
- math
- core
- framework
- graph/contrib_ops
- mlas/lib
- providers
- cann
- cpu
- fp16
- quantization
- cuda
- atomic
- math
- migraphx
- openvino/qdq_transformations
- qnn
- util
- lora
- test
- common
- framework
- mlas/bench
- onnx
- optimizer
- providers
- cuda/test_cases
- openvino
- qnn
- unittest_util
- orttraining/orttraining/core/graph
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
54 files changed
+65
-65
lines changedFile renamed without changes.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
0 commit comments