From 909ee88557e14bcdbed8ed89ce75502a709931cc Mon Sep 17 00:00:00 2001 From: Nick Sarnie Date: Tue, 2 Dec 2025 20:21:03 +0000 Subject: [PATCH] Revert "[SYCL][E2E] Fix lit for arch selection and l0v2 adapter (#20728)" This reverts commit 046f67df547334ee13a887380f8679c5f825f60e. --- sycl/test-e2e/AddressSanitizer/lit.local.cfg | 3 +- sycl/test-e2e/MemorySanitizer/lit.local.cfg | 3 +- sycl/test-e2e/ThreadSanitizer/lit.local.cfg | 3 +- sycl/test-e2e/format.py | 22 +------------- sycl/test-e2e/lit.cfg.py | 30 ++------------------ 5 files changed, 6 insertions(+), 55 deletions(-) diff --git a/sycl/test-e2e/AddressSanitizer/lit.local.cfg b/sycl/test-e2e/AddressSanitizer/lit.local.cfg index 7694aea414c55..50308766f8292 100644 --- a/sycl/test-e2e/AddressSanitizer/lit.local.cfg +++ b/sycl/test-e2e/AddressSanitizer/lit.local.cfg @@ -31,5 +31,4 @@ unsupported_san_flags = [ if any(flag in config.cxx_flags for flag in unsupported_san_flags): config.unsupported=True -if config.ze_affinity_mask is not None: - config.environment["ZE_AFFINITY_MASK"] = config.ze_affinity_mask +config.environment["ZE_AFFINITY_MASK"] = "0" diff --git a/sycl/test-e2e/MemorySanitizer/lit.local.cfg b/sycl/test-e2e/MemorySanitizer/lit.local.cfg index 18c7f7bd8f73f..a3cbd769b9d5c 100644 --- a/sycl/test-e2e/MemorySanitizer/lit.local.cfg +++ b/sycl/test-e2e/MemorySanitizer/lit.local.cfg @@ -39,5 +39,4 @@ unsupported_san_flags = [ if any(flag in config.cxx_flags for flag in unsupported_san_flags): config.unsupported=True -if config.ze_affinity_mask is not None: - config.environment["ZE_AFFINITY_MASK"] = config.ze_affinity_mask +config.environment["ZE_AFFINITY_MASK"] = "0" diff --git a/sycl/test-e2e/ThreadSanitizer/lit.local.cfg b/sycl/test-e2e/ThreadSanitizer/lit.local.cfg index 83db05b539f5b..c8234bc536a41 100644 --- a/sycl/test-e2e/ThreadSanitizer/lit.local.cfg +++ b/sycl/test-e2e/ThreadSanitizer/lit.local.cfg @@ -34,5 +34,4 @@ unsupported_san_flags = [ if any(flag in config.cxx_flags for flag in unsupported_san_flags): config.unsupported=True -if config.ze_affinity_mask is not None: - config.environment["ZE_AFFINITY_MASK"] = config.ze_affinity_mask +config.environment["ZE_AFFINITY_MASK"] = "0" diff --git a/sycl/test-e2e/format.py b/sycl/test-e2e/format.py index d6c390a7e4407..b503108f937b1 100644 --- a/sycl/test-e2e/format.py +++ b/sycl/test-e2e/format.py @@ -283,15 +283,6 @@ def get_extra_env(sycl_devices): # so that device might still be accessible to some of the tests yet # we won't set the environment variable below for such scenario. extra_env = [] - - # Include ZE_AFFINITY_MASK if set by lit.local.cfg (e.g., for sanitizer tests) - if "ZE_AFFINITY_MASK" in test.config.environment: - extra_env.append( - "ZE_AFFINITY_MASK={}".format( - test.config.environment["ZE_AFFINITY_MASK"] - ) - ) - if "level_zero:gpu" in sycl_devices and litConfig.params.get("ur_l0_debug"): extra_env.append("UR_L0_DEBUG={}".format(test.config.ur_l0_debug)) @@ -351,14 +342,8 @@ def get_extra_env(sycl_devices): elif "level_zero_v1" in full_dev_name: expanded += " env UR_LOADER_USE_LEVEL_ZERO_V2=0" - # If ZE_AFFINITY_MASK is set in local config, it filters devices so we should use :0 - device_selector = parsed_dev_name - if test.config.ze_affinity_mask is not None: - backend, _ = parsed_dev_name.split(":", 1) - device_selector = f"{backend}:0" - expanded += " ONEAPI_DEVICE_SELECTOR={} {}".format( - device_selector, test.config.run_launcher + parsed_dev_name, test.config.run_launcher ) cmd = directive.command.replace("%{run}", expanded) # Expand device-specific condtions (%if ... %{ ... %}). @@ -368,11 +353,6 @@ def get_extra_env(sycl_devices): "linux", "windows", "preview-breaking-changes-supported", - # the following entries are used by architecture-based filtering - # (:arch- device, not :gpu or :cpu) - "cpu", - "gpu", - "accelerator", ]: if cond_features in test.config.available_features: conditions[cond_features] = True diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index da4cc3465ca4e..d39cd7134e603 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -96,7 +96,6 @@ "LIBCLANG_NOTHREADS", "LIBCLANG_RESOURCE_USAGE", "LIBCLANG_CODE_COMPLETION_LOGGING", - "ZE_AFFINITY_MASK", ] # Names of the Release and Debug versions of the XPTIFW library @@ -918,14 +917,12 @@ def get_sycl_ls_verbose(sycl_device, env): env = copy.copy(llvm_config.config.environment) - backend_for_selector = backend.replace("_v2", "").replace("_v1", "") - # Find all available devices under the backend - env["ONEAPI_DEVICE_SELECTOR"] = backend_for_selector + ":*" + env["ONEAPI_DEVICE_SELECTOR"] = backend + ":*" detected_architectures = [] - platform_devices = backend_for_selector + ":*" + platform_devices = remove_level_zero_suffix(backend + ":*") for line in get_sycl_ls_verbose(platform_devices, env).stdout.splitlines(): if re.match(r" *Architecture:", line): @@ -951,15 +948,6 @@ def get_sycl_ls_verbose(sycl_device, env): config.sycl_devices = filtered_sycl_devices -# Determine ZE_AFFINITY_MASK for Level Zero devices. -# Sanitizer tests need to set ZE_AFFINITY_MASK to a single device index -config.ze_affinity_mask = None -for sycl_device in remove_level_zero_suffix(config.sycl_devices): - be, dev = sycl_device.split(":") - if be == "level_zero" and dev.isdigit(): - config.ze_affinity_mask = dev - break - for sycl_device in remove_level_zero_suffix(config.sycl_devices): be, dev = sycl_device.split(":") config.available_features.add("any-device-is-" + dev) @@ -1126,13 +1114,6 @@ def get_sycl_ls_verbose(sycl_device, env): features.update(device_family) be, dev = sycl_device.split(":") - if dev.isdigit(): - backend_devices = available_devices.get(be, "gpu") - if isinstance(backend_devices, tuple): - # arch-selection is typically used to select gpu device - dev = "gpu" - else: - dev = backend_devices features.add(dev.replace("fpga", "accelerator")) if "level_zero_v2" in full_name: features.add("level_zero_v2_adapter") @@ -1165,13 +1146,6 @@ def get_sycl_ls_verbose(sycl_device, env): else: config.intel_driver_ver[full_name] = {} -# When running with a single device, merge device-specific features into global -# available_features so that %if conditionals work correctly, even if device is not :gpu or :cpu -if len(config.sycl_devices) == 1: - single_device = list(config.sycl_dev_features.keys())[0] - device_features = config.sycl_dev_features[single_device] - config.available_features.update(device_features) - if lit_config.params.get("compatibility_testing", "False") != "False": config.substitutions.append(("%clangxx", " true ")) config.substitutions.append(("%clang", " true "))