You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sycl/doc/design/RFC_drafts/SYCLBINDesign.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,27 +15,30 @@ Community input is particularly valuable regarding potential integration challen
15
15
16
16
## Motivation and alternatives considered
17
17
18
-
### Metadata unique for SYCL programming model
18
+
### Requirements: SYCL-Specific metadata and modules hierarchy
19
19
20
-
-[ ] This section needs re-writing...
21
-
22
-
LLVM offloading infrastructure supports the following binary formats: Object, Bitcode, Cubin, Fatbinary, PTX and SPIRV which could be placed into OffloadBinary format. None of it satisfies the needs of SYCL programming model.
20
+
The SYCL programming model requires device images to be accompanied by specific metadata necessary for SYCL runtime operation:
23
21
24
-
-[ ] Steffen, I need to discuss with you, why other existing formats did not satisfy our needs. I think we need to provide short summary why each format doesn't work for us somewhere in this section.
2. Compiler and linker options for JIT compilation scenarios
24
+
3. List of entry points exposed by each image
25
+
4. Arrays of [property sets](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/PropertySets.md).
25
26
26
-
Specifically, SYCL needs to keep the following metadata necessary for SYCL runtime, which is not supported by any of existing formats:
27
+
When a binary contains multiple images, some may share common metadata. Therefore, we require a hierarchical structure that enables metadata sharing while allowing specification of image-specific metadata.
2. Compiler and linker options to pass to JIT compiler in case of JITing.
30
-
3. List of entry points exposed by an image
31
-
4. Arrays of property sets.
29
+
#### Existing Format Limitations:
32
30
33
-
While #1 and #2 can be saved to StringData of OffloadBinary, #3 requires additional handling, since StringData serialization infrastructure assumes that value is a single null-terminated string, so to restore multiple null-terminated strings from StringData format, they need to be concatenated with split symbol and then split during deserialization.
31
+
LLVM's offloading infrastructure supports several binary formats that can be embedded within the OffloadBinary format. However, these formats have various limitations that make them unsuitable for SYCL:
34
32
35
-
[Property sets](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/PropertySets.md) (#4) would be even more complicated.
33
+
-**Single-module design**: Formats like Object, Bitcode, CUBIN, PTX, and SPIRV are designed for single binary or single-module IR representation, lacking hierarchical structuring capabilities for multiple images/modules
34
+
-**Missing SYCL metadata support**: None provide native support for SYCL-specific metadata requirements
35
+
-**Vendor constraints**: Fatbinary is NVIDIA proprietary and incompatible with SYCL's vendor-neutral approach
36
+
-**Limited container capabilities**: OffloadBinary is not designed for multiple device images or hierarchical organization, with StringData insufficient for complex metadata structures (like #3 and #4 above).
36
37
37
38
### Abstraction: simplify support in offloading tools
38
39
40
+
-[ ] This section needs re-writing...
41
+
39
42
Another motivation to add SYCLBIN format is to encapsulate SYCL-specific logic to SYCL-specific parts of toolchain (clang-sycl-linker, SYCL runtime) and hide SYCL specifics from offloading tools intended to support multiple programming models. Without this format, we would need to use the following workflow to pass metadata (#1 - #4) from compiler to runtime:
40
43
41
44
1. clang-sycl-linker would use OffloadingImage’s StringData to save metadata #1-#4.
0 commit comments