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
[SYCL] Embed bfloat16 devicelib into executable if necessary (#16729)
Currently, sycl bfloat16 conversion functions are implemented in 2
devicelib spvs(fallback version and native version).
The native version targets for any platform which supports
"cl_intel_bfloat16_conversions" extension and fallback version is used
for all other platforms.
SYCL runtime will select the bfloat16 spvs during execution time by
checking bfloat16 extension.
The design requires us to ship 2 spv files together with sycl runtime
which some users may dislike.
The PR uses sycl dynamic library mechanism to re-implement this
behavior. These 2 bfloat16 lib files are regarded as dynamic library and
embedded to final executable, so we don't need to ship any bfloat16 spv
libs.
The PR consists following changes:
1. Driver: pass the devicelib file location to sycl-post-link tool.
2. sycl-post-link: analyze user's device image to see whether bfloat16
devicelib functions are used. If yes, add the 2 bfloat16 devicelib files
as "required" dynamic library. All required bfloat16 devicelib functions
are treated as "imported" symbols in user's device image and all
functions in bfloat16 devicelib are "exported" symbols.
3. Sycl runtime will load and link the required bfloat16 devicelib image
and resolve the imported symbols.
Fallback and native version of bfloat16 devicelib files have exactly
same exported functions, we add a new
metadata("SYCL_DEVICELIB_BF16_TYPE") to indicate the version in them.
SYCL runtime will check cl_intel_bfloat16_conversions extension and this
metadata to decide which version will be linked.
---------
Signed-off-by: jinge90 <[email protected]>
Co-authored-by: Steffen Larsen <[email protected]>
Co-authored-by: Alexey Sachkov <[email protected]>
0 commit comments