Skip to content

[SYCL] Remove SYCL_DEVICE_FILTER support #12384

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 14 commits into from
Jan 26, 2024

Conversation

uditagarwal97
Copy link
Contributor

@uditagarwal97 uditagarwal97 commented Jan 12, 2024

Overview
This PR removes support for SYCL_DEVICE_FILTER, and refactors Basic/diagnostics/device-check.cpp to use ONEAPI_DEVICE_FILTER instead of SYCL_DEVICE_TYPE, as the latter is depreciated.

@uditagarwal97 uditagarwal97 self-assigned this Jan 12, 2024
@uditagarwal97 uditagarwal97 changed the title [DRAFT][SYCL] Remove depreciated environment variables [SYCL] Remove depreciated environment variables Jan 12, 2024
@uditagarwal97 uditagarwal97 marked this pull request as ready for review January 12, 2024 21:25
@uditagarwal97 uditagarwal97 requested review from a team as code owners January 12, 2024 21:25
Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

ESIMD changes (sycl/test/invoke_simd/invoke_simd.cpp only) LGTM

@uditagarwal97
Copy link
Contributor Author

@steffenlarsen I've addressed your reviews from #12007 in this PR. Since Euna is inactive, I'll be taking forward this effort (that's why created a separate PR).

@@ -129,6 +131,7 @@ int filter_selector_impl::operator()(const device &Dev) const {
else
DeviceTypeOK = (DT == Filter.DeviceType);
}
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you clarify why this code relates only to one path and not the other? It's not immediately clear from the variable names below...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've fixed this. Apparently, removing this branch was changing the functionality of filter selector. So, instead I've now added a variable "MatchesSeen" in ods_target to keep track of the devices that matches this filter.

Comment on lines +165 to +166
// TODO: host device type will be removed once sycl_ext_oneapi_filter_selector
// is removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know if we should remove it under the same task (even though in a separate PR)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK, from #12007 (comment), we should perhaps first depreciate sycl_ext_oneapi_filter_selector and then, eventually remove or replace it. I think it would be better to do that in a separate task as it would require more discussion and it is loosely related to the current task of removing depreciated variables.

// RUN: %{build} -o %t.out
// RUN: env SYCL_DEVICE_FILTER='*' %{run-unfiltered-devices} %t.out &> %t.log
// RUN: FileCheck %s < %t.log
// RUN: %if !preview-breaking-changes-supported %{ %{build} -o %t.out %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need any changes in the tests using old filter - it's the default still.

@@ -129,6 +131,7 @@ int filter_selector_impl::operator()(const device &Dev) const {
else
DeviceTypeOK = (DT == Filter.DeviceType);
}
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these #ifdef lines changing the behavior of the filter_selector? I'm not sure we want to do that, and I didn't see any changes to the "sycl_ext_oneapi_filter_selector" extension specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I've fixed this. It was indeed changing the behavior of filter selector.

Copy link
Contributor

@kbenzie kbenzie left a comment

Choose a reason for hiding this comment

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

UR LGTM

Copy link
Contributor

@AlexeySachkov AlexeySachkov left a comment

Choose a reason for hiding this comment

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

doc changes LGTM

@@ -175,8 +176,21 @@ getSyclDeviceTypeMap() {
return SyclDeviceTypeMap;
}

// Array is used by SYCL_DEVICE_FILTER and SYCL_DEVICE_ALLOWLIST and
// ONEAPI_DEVICE_SELECTOR
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just #ifdef a single line with esimd_emulator and use auto return type to unify those two versions?

@uditagarwal97 uditagarwal97 changed the title [SYCL] Remove depreciated environment variables [SYCL] Remove SYCL_DEVICE_FILTER support Jan 17, 2024
Copy link
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

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

Doc and spec changes LGTM.

@uditagarwal97
Copy link
Contributor Author

A couple of minor comments.

I suggest updating PR title and description: "[SYCL] Remove depreciated environment variables" -> "[SYCL] Remove SYCL_DEVICE_FILTER support".

90+% of this patch related to just one environment variable.

Same as https://github.com/intel/llvm/pull/12007with additional changes.

Overview

NOTE: PR description will be a git log message when merged and I don't think we need this this information there. I would move this information from PR description to PR comments.

This PR removes depreciated environment variables, namely SYCL_BE, SYCL_DEVICE_FILTER, and SYCL_DEVICE_TYPE, along with depreciated esimd_emulator backend.

  1. I don't see any instance of SYCL_BE in this PR.
  2. SYCL_DEVICE_TYPE is used only in one test which just checks runtime emits diagnostics when this variable is set.
  3. esimd_emulator is not an environment variable, so I would move related changes to a separate PR.

Thanks, Alexey. I've made most of the suggested changes. Regarding moving esimd_emulator related changes to a separate PR, my concern is that esimd_emulator is supported only with SYCL_DEVICE_FILTER, not with ONEAPI_DEVICE_SELECTOR. So, the stuff I am migrating from SYCL_DEVICE_FILTER to ONEAPI_DEVICE_SELECTOR (like filter_selector) might fail if we don't remove the esimd_emulator support right away. The converse of this, i.e. removing esimd_emulator support before merging this PR, would also be incorrect as it is still valid for SYCL_DEVICE_FILTER.

Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

Thanks!

@uditagarwal97 uditagarwal97 marked this pull request as draft January 18, 2024 18:49
@uditagarwal97
Copy link
Contributor Author

Converted this PR to draft to prevent accidental merges. I'm trying to separate out esimd_emulator related changes from this PR to #12428. Once it gets merged, I'll refactor and open this PR again.

@uditagarwal97 uditagarwal97 marked this pull request as ready for review January 24, 2024 23:06
@uditagarwal97
Copy link
Contributor Author

@aelovikov-intel @bso-intel could you review this PR again? The only change made since the last review is the separation of ESIMD related changes in #12428

@aelovikov-intel aelovikov-intel merged commit 8d0fa98 into intel:sycl Jan 26, 2024
@aelovikov-intel
Copy link
Contributor

Post commit failures on Arc GPU:

Failed Tests (2):
  SYCL :: Basic/get_backend.cpp
  SYCL :: OneapiDeviceSelector/level_zero_top.cpp

The first is kind of known, see #12463 (comment).
The second is new to me, but looks passing in the previous/next jobs, so possibly unrelated.

@uditagarwal97 uditagarwal97 deleted the remove_depr_vars branch March 21, 2024 19:59
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.

8 participants