-
Notifications
You must be signed in to change notification settings - Fork 31
Gold/2021 #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
Dependency for numpy 1.17
This test checks for conformance to __sycl_usm_array_interface__ spect from Wiki
DPCLTDeviceMgr_GetDevices should not rely of the cached unordered map
of root sycl devices to sycl contexts. Because unordered map can change
the ordering.
Changed implementation to iterate over device::get_devices instead.
Confirmation of the fix:
```
In [1]: import dpctl
In [2]: d0 = dpctl.SyclDevice("gpu:0")
In [3]: d0.filter_string
Out[3]: 'opencl:gpu:0'
In [4]: [i for i, di in enumerate(dpctl.get_devices(dpctl.backend_type.all, dpctl.device_type.gpu)) if di == d0]
Out[4]: [0]
In [5]: d0 == dpctl.SyclDevice(d0.filter_string)
Out[5]: True
In [6]: d1 = dpctl.SyclDevice("gpu:1")
In [7]: d1.filter_string
Out[7]: 'level_zero:gpu:0'
In [8]: [i for i, di in enumerate(dpctl.get_devices(dpctl.backend_type.all, dpctl.device_type.gpu)) if di == d1]
Out[8]: [1]
In [9]: d1 == dpctl.SyclDevice(d1.filter_string)
Out[9]: True
```
DeviceType enums now are [0, 8), BackendType enums have lower 16 bits zero, and span [1<<16, 1<<20)
…ompiler.
- FindDPCPP.cmake is now renamed to FindIntelSycl.cmake.
- llvm-cov and llvm-profdata now have their own cmake modules
and the minimum version required is 11.0.0 for these tools.
- CMAKE_C_COMPILER and CMAKE_CXX_COMPILER are now set by the
FindIntelSycl.cmake module and do not need to be set manually.
- A new CMAKE flag DPCTL_CUSTOM_DPCPP_INSTALL_DIR is now available
that makes it possible to build the DPCTLSyclInterface with a
custom dpcpp compiler.
- Formatting changes to CMakeLists.txt files.
- A new helper script to build the DPCTLSyclInterface library using a
custom dpcpp.
- All version checking for CMake modules requirements uses LESS_EQUAL
instead of EQUAL.
- Replaced FindLevelZero cmake module with GetLevelZeroHeaders module which
checks out Level zero repo to satisfy dependency of DPCTL on Level-zero
headers when configured
- Added GetProjectVersion cmake module to get version and semantic version
information for Git repos.
Now that Level zero is being checkout out, the location of the .h file has changed and is controlled via include directory path.
This function is more general that DPCTL_GetRelativeId(DRef). The latter corresponds to DPCTLDeviceMgr_GetPositionInDevices(DRef, DPCTLDevice_GetBackend(DRef) | DPCTLDevice_GetDeviceType(DRef)); The function can be used to generate filter selector based on a pattern, expressed by device_mask (any backend, given type), or (any backend, any type), or (given backend, given type).
dpctl.SyclDevice.filter_string property gives fully specified filter selector, which includes backend, device_type and relative id. get_filter_string(include_backend, include_device_type) allows one to construct filter strings which would omit either backend or device_type or both, guaranteeing that dpctl.SyclDevice(obtained_selector_string) will give back the same device. ``` In [1]: import dpctl In [2]: default_dev = dpctl.SyclDevice() In [3]: default_dev.get_filter_string(include_backend=False) Out[3]: 'gpu:1' In [4]: default_dev.get_filter_string(include_device_type=False) Out[4]: 'level_zero:0' In [5]: default_dev.get_filter_string(include_device_type=False, include_backend=False) Out[5]: '4' ```
The logic to build the backend is moved inside a function, allowing to pass argument controlling the build. Currently this is used to specify whether to use L0 support (hardcoded to True), but opens a door to specify custom compiler to use to build SyclInterface library. setup.py no longer uses subprocess to invoke build_backed, but uses importlib to import the function defined there and calls the function with appropriate arguments. scipts/build_backend.py retains the function of the script, calling the build_backend function with default arguments (no L0 support)
python setup.py develop ---help displays them, with use messaes Options are --level-zerop-support=(true|false) --coverage=(true|false) --sycl-compiler-path=(path to prefix, optional) If path is not provided backend builder looks up ONEAPI_ROOT variable. In the path, builder looks for bin/dpcpp (Linux), or bin/dpcpp.exe (Windows). If found, cmake does see -DDPCTL_DPCPP_ROOT variable set. Otherwise the variable is set, and clang++ is used instead of dpcpp
CODE_COVERAGE was used to influence whether the backend SyclInterface library was built in debug mode with coverage over dpctp-capi/ test suite collected or not. It was also influencing how Cython extensions were built. It would pass linetrace=true option to cythonize, and define CYTHON_TRACE preprocessor variable when compiling Cython-generated C++ source files with compiler. This change removes use CODE_COVERAGE all together. Instead: 1. Custom setuptools command 'build_ext' is implemented which auto-adds 'CYTHON_TRACE' to the list of defines received by downstream build_ext command if develop command received --coverage=True cythonize call was removed from extensions() function, allowing ``python setup.py develop --help` execute cleanly without running cythonize. Consequentially, linetrace Cython directive will need to be added to each .pyx file in a separate commit. This is safe to do per https://cython.readthedocs.io/en/latest/src/tutorial/profiling_tutorial.html#enabling-line-tracing since it is a no-op unless CYTHON_TRACE preprocessor variable is also set, which is only done when --coverage=True is used 2. install setuptools command removed support for `--coverage` option, and always builds backend without coverage. This is to avoid inadvertent installation of debug build of library in Python prefix.
This is safe to do per https://cython.readthedocs.io/en/latest/src/tutorial/profiling_tutorial.html#enabling-line-tracing Its use allows improved coverage testing of Cython modules when Cython sources are compiled with CYTHON_TRACE/CYTHON_TRACE_NOGIL preprocessor variables defined.
* Correctly copy symlinks to the dpctl dir, but avoid copying if the symlink was previously copied.
…lls.io.
- A new github action that builds dpctl in develop mode with
coverage enabled.
- The coverage reports for dpctl C and Python APIs are merged
and uploaded to coveralls.io.
Expanded the test checking consistency between NumPy's and dpctl's notions
…rototype) (#463) * Changes to make dpctl-capi headers C complaint and satisfy `-Wstrict-prototype` Co-authored-by: Oleksandr Pavlyk <oleksandr.pavlyk@intel.com>
…setup steps are run to collect headers generated by cythonization (#464)
Collaborator
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.
Merge gold/2021 into master.