From 8df071fde9c2934e7498a3ac637b71c5e45fa395 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Sun, 1 Dec 2024 09:59:56 -0800 Subject: [PATCH 1/8] Automatically add device name feature from architecture reported by sycl-ls --- .github/workflows/sycl-linux-precommit.yml | 5 ++--- .github/workflows/sycl-nightly.yml | 3 --- .github/workflows/sycl-post-commit.yml | 5 ++--- sycl/test-e2e/lit.cfg.py | 23 ++++++++++++++++++++++ 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/sycl-linux-precommit.yml b/.github/workflows/sycl-linux-precommit.yml index 231d49b0500c5..acc336f2e629e 100644 --- a/.github/workflows/sycl-linux-precommit.yml +++ b/.github/workflows/sycl-linux-precommit.yml @@ -92,14 +92,13 @@ jobs: image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN target_devices: level_zero:gpu;opencl:gpu;opencl:cpu reset_intel_gpu: true - extra_lit_opts: --param gpu-intel-gen12=True - name: E2E tests on Intel Arc A-Series Graphics runner: '["Linux", "arc"]' image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:latest image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN target_devices: level_zero:gpu;opencl:gpu reset_intel_gpu: true - extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True + extra_lit_opts: --param matrix-xmx8=True env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }' - name: E2E tests with dev igc on Intel Arc A-Series Graphics runner: '["Linux", "arc"]' @@ -107,7 +106,7 @@ jobs: image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN target_devices: level_zero:gpu;opencl:gpu reset_intel_gpu: true - extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True + extra_lit_opts: --param matrix-xmx8=True env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }' use_igc_dev: true diff --git a/.github/workflows/sycl-nightly.yml b/.github/workflows/sycl-nightly.yml index 4becda0c89f82..a9401bdf8596e 100644 --- a/.github/workflows/sycl-nightly.yml +++ b/.github/workflows/sycl-nightly.yml @@ -57,7 +57,6 @@ jobs: target_devices: level_zero:gpu reset_intel_gpu: true tests_selector: e2e - extra_lit_opts: --param gpu-intel-gen12=True - name: Intel OCL GPU runner: '["Linux", "gen12"]' @@ -66,7 +65,6 @@ jobs: target_devices: opencl:gpu reset_intel_gpu: true tests_selector: e2e - extra_lit_opts: --param gpu-intel-gen12=True - name: OCL CPU (AMD) runner: '["Linux", "amdgpu"]' @@ -139,7 +137,6 @@ jobs: name: Intel GEN12 Graphics with Level Zero runner: '["Windows","gen12"]' sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }} - extra_lit_opts: --param gpu-intel-gen12=True cuda-aws-start: needs: [ubuntu2204_build] diff --git a/.github/workflows/sycl-post-commit.yml b/.github/workflows/sycl-post-commit.yml index 1abd497a9c97c..06c2988c2bd64 100644 --- a/.github/workflows/sycl-post-commit.yml +++ b/.github/workflows/sycl-post-commit.yml @@ -56,7 +56,7 @@ jobs: reset_intel_gpu: true - name: Intel Arc A-Series Graphics with Level Zero runner: '["Linux", "arc"]' - extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True + extra_lit_opts: --param matrix-xmx8=True reset_intel_gpu: true - name: AMD/HIP runner: '["Linux", "amdgpu"]' @@ -73,7 +73,7 @@ jobs: - name: Perf tests on Intel GEN12 Graphics system runner: '["Linux", "gen12"]' env: '{"LIT_FILTER":"PerformanceTests/"}' - extra_lit_opts: -a -j 1 --param enable-perf-tests=True --param gpu-intel-gen12=True + extra_lit_opts: -a -j 1 --param enable-perf-tests=True target_devices: all reset_intel_gpu: true - name: Perf tests on Intel Arc A-Series Graphics system @@ -120,7 +120,6 @@ jobs: name: Intel GEN12 Graphics with Level Zero runner: '["Windows","gen12"]' sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }} - extra_lit_opts: --param gpu-intel-gen12=True macos_default: name: macOS diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 2ef9ac91ce299..09ef4d11ed0dc 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -173,6 +173,25 @@ if lit_config.params.get("igc-dev", False): config.available_features.add("igc-dev") +# Map between architecture types and device name. +device_name_arch_map = { + # : Set of architectures types (and aliases) + # DG1 + "gpu-intel-dg1" : {"intel_gpu_dg1"}, + # DG2 + "gpu-intel-dg2" : {"intel_gpu_acm_g12","intel_gpu_dg2_g12","intel_gpu_acm_g11","intel_gpu_dg2_g11","intel_gpu_acm_g10","intel_gpu_dg2_g10"}, + # Gen12 + "gpu-intel-gen12" : {"intel_gpu_tgllp","intel_gpu_tgl"}, + # Gen11 + "gpu-intel-gen11" : {"intel_gpu_icllp","intel_gpu_icl"}, +} + +def get_device_name_from_arch(arch): + for device_name, arch_set in device_name_arch_map.items(): + if arch in arch_set: + return device_name + return None + def check_igc_tag_and_add_feature(): if os.path.isfile(config.igc_tag_file): with open(config.igc_tag_file, "r") as tag_file: @@ -768,10 +787,14 @@ def open_check_file(file_name): aspect_features = set("aspect-" + a for a in aspects) sg_size_features = set("sg-" + s for s in sg_sizes) architecture_feature = set("arch-" + s for s in architectures) + # Add device name features like intel-gpu-gen12, intel-gpu-dg2 based on + # the architecture reported by sycl-ls. + device_names = set(get_device_name_from_arch(arch) for arch in architectures if get_device_name_from_arch(arch) is not None) features = set() features.update(aspect_features) features.update(sg_size_features) features.update(architecture_feature) + features.update(device_names) be, dev = sycl_device.split(":") features.add(dev.replace("fpga", "accelerator")) From 7ce23a4140c3617e83620e5b4d32bbd5e44095f4 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Mon, 2 Dec 2024 05:25:32 -0800 Subject: [PATCH 2/8] Remove additional usages of gpu-intel-* --- .github/workflows/sycl-post-commit.yml | 1 - .github/workflows/sycl-windows-precommit.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/sycl-post-commit.yml b/.github/workflows/sycl-post-commit.yml index 06c2988c2bd64..70c7e01d7008b 100644 --- a/.github/workflows/sycl-post-commit.yml +++ b/.github/workflows/sycl-post-commit.yml @@ -51,7 +51,6 @@ jobs: include: - name: Intel GEN12 Graphics with Level Zero runner: '["Linux", "gen12"]' - extra_lit_opts: --param gpu-intel-gen12=True target_devices: level_zero:gpu;opencl:fpga reset_intel_gpu: true - name: Intel Arc A-Series Graphics with Level Zero diff --git a/.github/workflows/sycl-windows-precommit.yml b/.github/workflows/sycl-windows-precommit.yml index a82c2b7814d75..ccd10950b3da2 100644 --- a/.github/workflows/sycl-windows-precommit.yml +++ b/.github/workflows/sycl-windows-precommit.yml @@ -55,4 +55,3 @@ jobs: name: Intel GEN12 Graphics with Level Zero runner: '["Windows","gen12"]' sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }} - extra_lit_opts: --param gpu-intel-gen12=True From 1f920408e20d114f5c2d8e4c884ba0489d91b3f5 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Mon, 2 Dec 2024 05:42:11 -0800 Subject: [PATCH 3/8] Git format --- sycl/test-e2e/lit.cfg.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 09ef4d11ed0dc..630ccd46692ee 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -177,15 +177,23 @@ device_name_arch_map = { # : Set of architectures types (and aliases) # DG1 - "gpu-intel-dg1" : {"intel_gpu_dg1"}, + "gpu-intel-dg1": {"intel_gpu_dg1"}, # DG2 - "gpu-intel-dg2" : {"intel_gpu_acm_g12","intel_gpu_dg2_g12","intel_gpu_acm_g11","intel_gpu_dg2_g11","intel_gpu_acm_g10","intel_gpu_dg2_g10"}, + "gpu-intel-dg2": { + "intel_gpu_acm_g12", + "intel_gpu_dg2_g12", + "intel_gpu_acm_g11", + "intel_gpu_dg2_g11", + "intel_gpu_acm_g10", + "intel_gpu_dg2_g10", + }, # Gen12 - "gpu-intel-gen12" : {"intel_gpu_tgllp","intel_gpu_tgl"}, + "gpu-intel-gen12": {"intel_gpu_tgllp", "intel_gpu_tgl"}, # Gen11 - "gpu-intel-gen11" : {"intel_gpu_icllp","intel_gpu_icl"}, + "gpu-intel-gen11": {"intel_gpu_icllp", "intel_gpu_icl"}, } + def get_device_name_from_arch(arch): for device_name, arch_set in device_name_arch_map.items(): if arch in arch_set: @@ -789,7 +797,11 @@ def open_check_file(file_name): architecture_feature = set("arch-" + s for s in architectures) # Add device name features like intel-gpu-gen12, intel-gpu-dg2 based on # the architecture reported by sycl-ls. - device_names = set(get_device_name_from_arch(arch) for arch in architectures if get_device_name_from_arch(arch) is not None) + device_names = set( + get_device_name_from_arch(arch) + for arch in architectures + if get_device_name_from_arch(arch) is not None + ) features = set() features.update(aspect_features) features.update(sg_size_features) From b94153b8d599b596d093b335e8043fc4a5b0f67a Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Mon, 2 Dec 2024 05:45:42 -0800 Subject: [PATCH 4/8] Print detected GPU family. --- sycl/test-e2e/lit.cfg.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 630ccd46692ee..53c0e9dbf2a64 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -802,6 +802,13 @@ def open_check_file(file_name): for arch in architectures if get_device_name_from_arch(arch) is not None ) + + # Print the detected GPU family name. + if len(device_names) > 0: + lit_config.note( + "Detected GPU family for {}: {}".format(sycl_device, ", ".join(device_names)) + ) + features = set() features.update(aspect_features) features.update(sg_size_features) From b3e213748e3c8cd4bf2a249eb2f255b44dcddd67 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Mon, 2 Dec 2024 05:53:34 -0800 Subject: [PATCH 5/8] More formatting changes --- sycl/test-e2e/lit.cfg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 53c0e9dbf2a64..ae2b66b5a21f6 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -806,7 +806,9 @@ def open_check_file(file_name): # Print the detected GPU family name. if len(device_names) > 0: lit_config.note( - "Detected GPU family for {}: {}".format(sycl_device, ", ".join(device_names)) + "Detected GPU family for {}: {}".format( + sycl_device, ", ".join(device_names) + ) ) features = set() From c4c7004ec3ff5cf99e924169a22613c7cc4b53d6 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Fri, 20 Dec 2024 12:11:30 -0800 Subject: [PATCH 6/8] Remove dg1; Update doc --- sycl/test-e2e/README.md | 12 ++++-------- sycl/test-e2e/lit.cfg.py | 29 +++++++++++++---------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/sycl/test-e2e/README.md b/sycl/test-e2e/README.md index 1df9e685968f9..f6f79c420b66b 100644 --- a/sycl/test-e2e/README.md +++ b/sycl/test-e2e/README.md @@ -232,6 +232,10 @@ environment: * **aspect-\**: - SYCL aspects supported by a device; * **arch-\** - [SYCL architecture](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_device_architecture.asciidoc) of a device (e.g. `arch-intel_gpu_pvc`, the name matches what you can pass into `-fsycl-targets` compiler flag); + * **gpu-intel-dg2** - Intel GPU DG2 availability; Automatically set if device + architecture belongs to DG2 family; + * **gpu-intel-gen11** - Intel GPU Gen11 availability; Automatically set if device architecture belongs to Gen11 family; + * **gpu-intel-gen12** - Intel GPU DG2 availability; Automatically set if device architecture belongs to Gen12 family; ### Manually-set features @@ -240,18 +244,10 @@ section below). All these features are related to HW detection and they should be considered deprecated, because we have HW auto-detection functionality in place. No new tests should use these features: - * **gpu-intel-gen11** - Intel GPU Gen11 availability; - * **gpu-intel-gen12** - Intel GPU Gen12 availability; * **gpu-intel-dg1** - Intel GPU DG1 availability; - * **gpu-intel-dg2** - Intel GPU DG2 availability; * **gpu-intel-pvc** - Intel GPU PVC availability; * **gpu-intel-pvc-vg** - Intel GPU PVC-VG availability; -Note: some of those features describing whole GPU families and auto-detection -of HW does not provide this functionality at the moment. As an improvement, we -could add those features even with auto-detection, because the only alternative -at the moment is to explicitly list every architecture from a family. - ## llvm-lit parameters Following options can be passed to llvm-lit tool through --param option to diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index ae2b66b5a21f6..ca84e1f46ea0f 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -173,11 +173,9 @@ if lit_config.params.get("igc-dev", False): config.available_features.add("igc-dev") -# Map between architecture types and device name. -device_name_arch_map = { - # : Set of architectures types (and aliases) - # DG1 - "gpu-intel-dg1": {"intel_gpu_dg1"}, +# Map between device family and architecture types. +device_family_arch_map = { + # : Set of architectures types (and aliases) # DG2 "gpu-intel-dg2": { "intel_gpu_acm_g12", @@ -193,11 +191,10 @@ "gpu-intel-gen11": {"intel_gpu_icllp", "intel_gpu_icl"}, } - -def get_device_name_from_arch(arch): - for device_name, arch_set in device_name_arch_map.items(): +def get_device_family_from_arch(arch): + for device_family, arch_set in device_family_arch_map.items(): if arch in arch_set: - return device_name + return device_family return None def check_igc_tag_and_add_feature(): @@ -795,19 +792,19 @@ def open_check_file(file_name): aspect_features = set("aspect-" + a for a in aspects) sg_size_features = set("sg-" + s for s in sg_sizes) architecture_feature = set("arch-" + s for s in architectures) - # Add device name features like intel-gpu-gen12, intel-gpu-dg2 based on + # Add device family features like intel-gpu-gen12, intel-gpu-dg2 based on # the architecture reported by sycl-ls. - device_names = set( - get_device_name_from_arch(arch) + device_family = set( + get_device_family_from_arch(arch) for arch in architectures - if get_device_name_from_arch(arch) is not None + if get_device_family_from_arch(arch) is not None ) # Print the detected GPU family name. - if len(device_names) > 0: + if len(device_family) > 0: lit_config.note( "Detected GPU family for {}: {}".format( - sycl_device, ", ".join(device_names) + sycl_device, ", ".join(device_family) ) ) @@ -815,7 +812,7 @@ def open_check_file(file_name): features.update(aspect_features) features.update(sg_size_features) features.update(architecture_feature) - features.update(device_names) + features.update(device_family) be, dev = sycl_device.split(":") features.add(dev.replace("fpga", "accelerator")) From 948921a84a9559f5402b30955d369dc63c968907 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Fri, 20 Dec 2024 12:27:20 -0800 Subject: [PATCH 7/8] Fix formatting --- sycl/test-e2e/lit.cfg.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 03e57eb66845d..543013dbf9645 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -194,6 +194,7 @@ "gpu-intel-gen11": {"intel_gpu_icllp", "intel_gpu_icl"}, } + def get_device_family_from_arch(arch): for device_family, arch_set in device_family_arch_map.items(): if arch in arch_set: From 56f26b955c07b4778bb3eb332370e6d87b198032 Mon Sep 17 00:00:00 2001 From: Udit Kumar Agarwal Date: Fri, 20 Dec 2024 12:36:03 -0800 Subject: [PATCH 8/8] Update sycl/test-e2e/README.md Co-authored-by: Artur Gainullin --- sycl/test-e2e/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/README.md b/sycl/test-e2e/README.md index 82f3537385c5a..cdf347e145edd 100644 --- a/sycl/test-e2e/README.md +++ b/sycl/test-e2e/README.md @@ -235,7 +235,7 @@ environment: * **gpu-intel-dg2** - Intel GPU DG2 availability; Automatically set if device architecture belongs to DG2 family; * **gpu-intel-gen11** - Intel GPU Gen11 availability; Automatically set if device architecture belongs to Gen11 family; - * **gpu-intel-gen12** - Intel GPU DG2 availability; Automatically set if device architecture belongs to Gen12 family; + * **gpu-intel-gen12** - Intel GPU Gen12 availability; Automatically set if device architecture belongs to Gen12 family; ### Manually-set features