Repository navigation
[SYCL] Changes SYCL data types configuration - #217
Merged
lukeiwanski merged 1 commit intoMar 1, 2018
Merged
lukeiwanski merged 1 commit into
lukeiwanski merged 1 commit into
Conversation
Set the required flags to disable certain data types for SYCL in the configure script, directly setting cxxopts in the bazelrc. This means that these flags are provided without having to set them in the compiler script.
DuncanMcBain
approved these changes
Mar 1, 2018
lukeiwanski
pushed a commit
that referenced
this pull request
Apr 17, 2018
Co-authored-by: John Lawson <[email protected]> Co-authored-by: Duncan McBain <[email protected]> Moved ACL config from configure.py to bazel.rc, matching previous TensorFlow upstream changes. Fixes ACL build. (#6) First steps to cross compilation Removed some things that are not needed, started adding definitions for arm toolchains. computecpp.tpl script is next and needs to be aware of compiling for the host. Add correct flags to crosstool Add temporary compiler hack Fix broken cxx_flags in crosstool Fixup Aarch64 toolchain components Add BUILD.tpl entry for arm cross compiler Target arm32 with correct directories Further improvements to the crosscompile toolchain Now there is a templated bash script that sets the target, gcc-toolchain and sysroot for compute (the c-like compute++). This means that we no longer need the version flag, as clang will basically work it out for us. Similarly, all the builtin directories and include lines have been removed from the CROSSTOOL as they're not needed any more! This successfully compiles the host and device objects, but fails to link because it is not aware that two libComputeCpp.so files are needed - one for host, and one for device. Change where ComputeCpp is linked Now we don't need a host copy of libComputeCpp.so, which makes sense, as it is only used on the target. Remove host compiler check in configure script Fix build config for bazel 0.9.1 Remove compute-script from SYCL config Using compiler_flag and linker_flag means that C files can see the target we are using, so the custom compute-script is no longer needed. This has simplified things considerably! Add dependency on syclrt to GRU and LSTM ops Removed unneeded code. Set the same build options for both local and cross-build, as much as possible. Added host_crosstool_top to the SYCL lines of tools/bazel.rc, and tidied it up a bit. Renamed ARM_BITCODE_TARGET to BITCODE_TARGET. Fixed build flags from my previous changes. Fix core kernel tests not building The kernels didn't have a dependency on the SYCL runtime, which has now been added (hidden behind the if_sycl function). Only prompt user for CROSS_TOOLCHAIN if needed Previously, the sycl_configure file would complain if the env variables for the cross toolchain couldn't be found - now, it will only ask about them if the environment variable "CROSS_TOOLCHAIN" is present, indicating that the user wants to crosscompile TensorFlow + SYCL. The names have been updated to indicate that the crosscompiling is flexible enough to work with other GCC-like toolchains, should the need ever arise. Fix autodetection of crosscompilation It now checks the environment in the correct way to see if the user wishes to crosscompile. Add Khronos OpenCL loader bazel configuration ComputeCpp depends on the OpenCL library to communicate with hardware. Previously, the OpenCL symbols were being resolved dynamically, which worked well for the Tensorflow wheel, but doesn't for the tests. This commit adds a minimal bazel configuration for the OpenCL ICD loader from Khronos and the OpenCL headers, then sets up the dependencies, such that ComputeCpp depends on the loader, which in turn depends on the headers. This is more robust as it means that the build depends less on how the building system is configured. Improve OpenCL bazel configuration OpenCL is now a cc_library, meaning that all the kernel tests are linked against its bits statically. It also uses the exports map from the ICD repo to indicate versions of the files within it, so should be compatible with ICD loaders from other vendors. The headers are no longer an inc_library, as bazel authors indicate that this is not a useful rule, and library seems to suffice for this case. As of now, the bazel config will build all tests and the pip package! [SYCL] Changes SYCL data types configuration (#217) Set the required flags to disable certain data types for SYCL in the configure script, directly setting cxxopts in the bazelrc. This means that these flags are provided without having to set them in the compiler script. Fix bad merge to fix configuration of build Add syclrt dependency to conv_op test Move syclrt dependency Clean OpenCL headers [SYCL] Add SYCL bitcode configure option Add a configure time option to specify the SYCL target bitcode to pass to ComputeCpp. By default this is spir64 for AMD devices, but it can be changed to match the actual device to compiler for. Note: There is no check to ensure that the target is supported by ComputeCpp, nor is there a check to ensure that the traget matches the device.
lukeiwanski
pushed a commit
that referenced
this pull request
Jul 6, 2018
Co-authored-by: John Lawson <[email protected]> Co-authored-by: Duncan McBain <[email protected]> Moved ACL config from configure.py to bazel.rc, matching previous TensorFlow upstream changes. Fixes ACL build. (#6) First steps to cross compilation Removed some things that are not needed, started adding definitions for arm toolchains. computecpp.tpl script is next and needs to be aware of compiling for the host. Add correct flags to crosstool Add temporary compiler hack Fix broken cxx_flags in crosstool Fixup Aarch64 toolchain components Add BUILD.tpl entry for arm cross compiler Target arm32 with correct directories Further improvements to the crosscompile toolchain Now there is a templated bash script that sets the target, gcc-toolchain and sysroot for compute (the c-like compute++). This means that we no longer need the version flag, as clang will basically work it out for us. Similarly, all the builtin directories and include lines have been removed from the CROSSTOOL as they're not needed any more! This successfully compiles the host and device objects, but fails to link because it is not aware that two libComputeCpp.so files are needed - one for host, and one for device. Change where ComputeCpp is linked Now we don't need a host copy of libComputeCpp.so, which makes sense, as it is only used on the target. Remove host compiler check in configure script Fix build config for bazel 0.9.1 Remove compute-script from SYCL config Using compiler_flag and linker_flag means that C files can see the target we are using, so the custom compute-script is no longer needed. This has simplified things considerably! Add dependency on syclrt to GRU and LSTM ops Removed unneeded code. Set the same build options for both local and cross-build, as much as possible. Added host_crosstool_top to the SYCL lines of tools/bazel.rc, and tidied it up a bit. Renamed ARM_BITCODE_TARGET to BITCODE_TARGET. Fixed build flags from my previous changes. Fix core kernel tests not building The kernels didn't have a dependency on the SYCL runtime, which has now been added (hidden behind the if_sycl function). Only prompt user for CROSS_TOOLCHAIN if needed Previously, the sycl_configure file would complain if the env variables for the cross toolchain couldn't be found - now, it will only ask about them if the environment variable "CROSS_TOOLCHAIN" is present, indicating that the user wants to crosscompile TensorFlow + SYCL. The names have been updated to indicate that the crosscompiling is flexible enough to work with other GCC-like toolchains, should the need ever arise. Fix autodetection of crosscompilation It now checks the environment in the correct way to see if the user wishes to crosscompile. Add Khronos OpenCL loader bazel configuration ComputeCpp depends on the OpenCL library to communicate with hardware. Previously, the OpenCL symbols were being resolved dynamically, which worked well for the Tensorflow wheel, but doesn't for the tests. This commit adds a minimal bazel configuration for the OpenCL ICD loader from Khronos and the OpenCL headers, then sets up the dependencies, such that ComputeCpp depends on the loader, which in turn depends on the headers. This is more robust as it means that the build depends less on how the building system is configured. Improve OpenCL bazel configuration OpenCL is now a cc_library, meaning that all the kernel tests are linked against its bits statically. It also uses the exports map from the ICD repo to indicate versions of the files within it, so should be compatible with ICD loaders from other vendors. The headers are no longer an inc_library, as bazel authors indicate that this is not a useful rule, and library seems to suffice for this case. As of now, the bazel config will build all tests and the pip package! [SYCL] Changes SYCL data types configuration (#217) Set the required flags to disable certain data types for SYCL in the configure script, directly setting cxxopts in the bazelrc. This means that these flags are provided without having to set them in the compiler script. Fix bad merge to fix configuration of build Add syclrt dependency to conv_op test Move syclrt dependency Clean OpenCL headers [SYCL] Add SYCL bitcode configure option Add a configure time option to specify the SYCL target bitcode to pass to ComputeCpp. By default this is spir64 for AMD devices, but it can be changed to match the actual device to compiler for. Note: There is no check to ensure that the target is supported by ComputeCpp, nor is there a check to ensure that the traget matches the device.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set the required flags to disable certain data types for SYCL in the configure script, directly setting cxxopts in the bazelrc. This means that these flags are provided without having to set them in the
compiler script.