Skip to content

[SYCL][Level Zero] Enable multi-CCS support. #4038

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

Merged
merged 18 commits into from
Jul 20, 2021
Merged

[SYCL][Level Zero] Enable multi-CCS support. #4038

merged 18 commits into from
Jul 20, 2021

Conversation

rbegam
Copy link
Contributor

@rbegam rbegam commented Jul 1, 2021

Signed-off-by: rehana begam [email protected]

@rbegam rbegam requested a review from smaslov-intel as a code owner July 1, 2021 23:48
@smaslov-intel
Copy link
Contributor

@rbegam , please fix clang-format.
Did you already created a test?

@rbegam
Copy link
Contributor Author

rbegam commented Jul 9, 2021

ping @smaslov-intel @jandres742

@smaslov-intel smaslov-intel changed the title [DPC++] enable multi-context (c-slice) support. [DPC++] enable multi-CCS support. Jul 9, 2021
@rbegam rbegam requested a review from a team as a code owner July 15, 2021 22:31
Comment on lines 1819 to 1824
pi_result Res = Device->Platform->populateDeviceCacheIfNeeded();
if (Res != PI_SUCCESS) {
return Res;
}

return ReturnValue(pi_uint32{(unsigned int)(Device->SubDevices.size())});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can run this exact code for root-devices as well

ZE_CALL(zeDeviceGetSubDevices, (ZeDevice, &ZeSubDeviceCount, nullptr));
if (ZeSubDeviceCount < 2) {
return ReturnValue(pi_device_partition_property{0});
if (!Device->isSubDevice()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are going to return non-zero vector for sub-devices, why is it OK? Also please change the code to get # of sub-devices from the cache (instead of repeating call to zeDeviceGetSubDevices)

rbegam added 15 commits July 19, 2021 11:32
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
@bader bader requested a review from smaslov-intel July 19, 2021 18:33
Comment on lines 567 to 568
const char *CopyEngine = std::getenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE");
bool UseCopyEngine = (!CopyEngine || (std::stoi(CopyEngine) != 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rewrite it similar to zeSerialize so that it is only executed once

return PI_ERROR_UNKNOWN;
}

ZeComputeEngineIndex = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This deserves a comment why we are using "0" and how it scales to HW

}

if (Ordinals.empty()) {
return PI_ERROR_UNKNOWN;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no sub-sub-devices, why error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, it should not be an error. this code is the reason for the pre-commit fail. I've fixed it, will upload soon.

Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
@rbegam
Copy link
Contributor Author

rbegam commented Jul 20, 2021

ping @smaslov-intel @jandres742

Signed-off-by: rehana begam <[email protected]>
@jandres742
Copy link
Contributor

LGTM

@bader bader changed the title [DPC++] enable multi-CCS support. [SYCL][Level Zero] Enable multi-CCS support. Jul 20, 2021
@bader bader merged commit 9bc3bc4 into intel:sycl Jul 20, 2021
alexbatashev added a commit to alexbatashev/llvm that referenced this pull request Jul 22, 2021
…ackend_plugin

* upstream/sycl: (26 commits)
  [SPIR-V][NFC] Move non-upstreamed FuncParam decorations into internal:: (intel#4138)
  [SYCL] Move free function queries to experimental namespace (intel#4090)
  [SYCL][XPTI] Enable PI calls notifications with arguments (intel#4148)
  [SYCL] Revert queue::wait() to its old behaviour with Level Zero (intel#4153)
  [SYCL] Add missing <cstring> header to spirv.hpp (intel#4157)
  [SYCL] Adds info query for atomic_memory_order_capabilities on device and context (intel#4105)
  [SYCL] Improve performance of generic shuffles (intel#3815)
  [SYCL] Fix the error with namespaces caused during rebase of intel#4014 (intel#4151)
  [ESIMD] Fix 'ambiguous operator' error with length 1 simd operands (intel#4149)
  [libdevice][NFC] Fix libdevice dependencies list (intel#4130)
  [SPIR-V] Reland Encode debug info producer in SPIR-V (intel#4082)
  [SYCL][ROCm] Add ROCm support to get_device_count_by_type (intel#4113)
  [SYCL] Fix sRGB device info (intel#4145)
  [SYCL][ROCm] Fix kernel launch with multiple dimensions (intel#4063)
  [SYCL][ROCm] Fix compilation for AMD GPU with -fsycl-dead-args-optimization (intel#4126)
  [SYCL][Level Zero] Enable multi-CCS support. (intel#4038)
  [SYCL] Pass bound arch to unbundler (intel#4112)
  [ESIMD][doc] Added documentation for some ESIMD math APIs (intel#3995)
  [ESIMD] rename gather4/scatter4 to gather_rgba/scatter_rgba (intel#4120)
  [SYCL][NFC] Remove unused variable. (intel#4131)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants