Skip to content

Commit f1fd672

Browse files
[E2E][CI] Automatically add device family feature from architecture reported by sycl-ls (#16220)
The PR adds GPU family features like `gpu-intel-gen12`, `gpu-intel-dg2` based on the specific architecture type reported by `sycl-ls`. After this change, you won't have to add `--param gpu-intel-gen12=True`/`--param gpu-intel-dg1=True`, etc LIT options when running E2E tests.
1 parent 01a909a commit f1fd672

File tree

6 files changed

+52
-18
lines changed

6 files changed

+52
-18
lines changed

.github/workflows/sycl-linux-precommit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ jobs:
143143
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
144144
target_devices: level_zero:gpu;opencl:gpu
145145
reset_intel_gpu: true
146-
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
146+
extra_lit_opts: --param matrix-xmx8=True
147147
env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }'
148148
- name: E2E tests with dev igc on Intel Arc A-Series Graphics
149149
runner: '["Linux", "arc"]'
150150
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
151151
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
152152
target_devices: level_zero:gpu;opencl:gpu
153153
reset_intel_gpu: true
154-
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
154+
extra_lit_opts: --param matrix-xmx8=True
155155
env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }'
156156
use_igc_dev: true
157157
- name: E2E tests on Intel Ponte Vecchio GPU

.github/workflows/sycl-nightly.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
target_devices: level_zero:gpu
5959
reset_intel_gpu: true
6060
tests_selector: e2e
61-
extra_lit_opts: --param gpu-intel-gen12=True
6261

6362
- name: Intel OCL GPU
6463
runner: '["Linux", "gen12"]'
@@ -67,7 +66,6 @@ jobs:
6766
target_devices: opencl:gpu
6867
reset_intel_gpu: true
6968
tests_selector: e2e
70-
extra_lit_opts: --param gpu-intel-gen12=True
7169

7270
- name: OCL CPU (AMD)
7371
runner: '["Linux", "amdgpu"]'
@@ -126,7 +124,6 @@ jobs:
126124
name: Intel GEN12 Graphics with Level Zero
127125
runner: '["Windows","gen12"]'
128126
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
129-
extra_lit_opts: --param gpu-intel-gen12=True
130127

131128
cuda-aws-start:
132129
needs: [ubuntu2204_build]

.github/workflows/sycl-post-commit.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ jobs:
4747
include:
4848
- name: Intel GEN12 Graphics with Level Zero
4949
runner: '["Linux", "gen12"]'
50-
extra_lit_opts: --param gpu-intel-gen12=True
5150
target_devices: level_zero:gpu;opencl:fpga
5251
reset_intel_gpu: true
5352
- name: Intel Arc A-Series Graphics with Level Zero
5453
runner: '["Linux", "arc"]'
55-
extra_lit_opts: --param matrix-xmx8=True --param gpu-intel-dg2=True
54+
extra_lit_opts: --param matrix-xmx8=True
5655
reset_intel_gpu: true
5756
- name: AMD/HIP
5857
runner: '["Linux", "amdgpu"]'
@@ -69,7 +68,7 @@ jobs:
6968
- name: Perf tests on Intel GEN12 Graphics system
7069
runner: '["Linux", "gen12"]'
7170
env: '{"LIT_FILTER":"PerformanceTests/"}'
72-
extra_lit_opts: -a -j 1 --param enable-perf-tests=True --param gpu-intel-gen12=True
71+
extra_lit_opts: -a -j 1 --param enable-perf-tests=True
7372
target_devices: all
7473
reset_intel_gpu: true
7574
- name: Perf tests on Intel Arc A-Series Graphics system
@@ -120,7 +119,6 @@ jobs:
120119
name: Intel GEN12 Graphics with Level Zero
121120
runner: '["Windows","gen12"]'
122121
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
123-
extra_lit_opts: --param gpu-intel-gen12=True
124122
compiler: icx
125123

126124
macos_default:

.github/workflows/sycl-windows-precommit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ jobs:
5555
name: Intel GEN12 Graphics with Level Zero
5656
runner: '["Windows","gen12"]'
5757
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
58-
extra_lit_opts: --param gpu-intel-gen12=True

sycl/test-e2e/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ environment:
239239
* **arch-\<name\>** - [SYCL architecture](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_device_architecture.asciidoc)
240240
of a device (e.g. `arch-intel_gpu_pvc`, the name matches what you can pass
241241
into `-fsycl-targets` compiler flag);
242+
* **gpu-intel-dg2** - Intel GPU DG2 availability; Automatically set if device
243+
architecture belongs to DG2 family;
244+
* **gpu-intel-gen11** - Intel GPU Gen11 availability; Automatically set if device
245+
architecture belongs to Gen11 family;
246+
* **gpu-intel-gen12** - Intel GPU Gen12 availability; Automatically set if device
247+
architecture belongs to Gen12 family;
242248
243249
#### Manually-set features
244250
@@ -247,17 +253,9 @@ section below). All these features are related to HW detection and they should
247253
be considered deprecated, because we have HW auto-detection functionality in
248254
place. No new tests should use these features:
249255
250-
* **gpu-intel-gen11** - Intel GPU Gen11 availability;
251-
* **gpu-intel-gen12** - Intel GPU Gen12 availability;
252-
* **gpu-intel-dg2** - Intel GPU DG2 availability;
253256
* **gpu-intel-pvc** - Intel GPU PVC availability;
254257
* **gpu-intel-pvc-vg** - Intel GPU PVC-VG availability;
255258
256-
Note: some of those features describing whole GPU families and auto-detection of
257-
HW does not provide this functionality at the moment. As an improvement, we
258-
could add those features even with auto-detection, because the only alternative
259-
at the moment is to explicitly list every architecture from a family.
260-
261259
### llvm-lit parameters
262260
263261
Following options can be passed to llvm-lit tool through --param option to

sycl/test-e2e/lit.cfg.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,31 @@
176176
if lit_config.params.get("igc-dev", False):
177177
config.available_features.add("igc-dev")
178178

179+
# Map between device family and architecture types.
180+
device_family_arch_map = {
181+
# <Family name> : Set of architectures types (and aliases)
182+
# DG2
183+
"gpu-intel-dg2": {
184+
"intel_gpu_acm_g12",
185+
"intel_gpu_dg2_g12",
186+
"intel_gpu_acm_g11",
187+
"intel_gpu_dg2_g11",
188+
"intel_gpu_acm_g10",
189+
"intel_gpu_dg2_g10",
190+
},
191+
# Gen12
192+
"gpu-intel-gen12": {"intel_gpu_tgllp", "intel_gpu_tgl"},
193+
# Gen11
194+
"gpu-intel-gen11": {"intel_gpu_icllp", "intel_gpu_icl"},
195+
}
196+
197+
198+
def get_device_family_from_arch(arch):
199+
for device_family, arch_set in device_family_arch_map.items():
200+
if arch in arch_set:
201+
return device_family
202+
return None
203+
179204
def check_igc_tag_and_add_feature():
180205
if os.path.isfile(config.igc_tag_file):
181206
with open(config.igc_tag_file, "r") as tag_file:
@@ -773,10 +798,27 @@ def open_check_file(file_name):
773798
aspect_features = set("aspect-" + a for a in aspects)
774799
sg_size_features = set("sg-" + s for s in sg_sizes)
775800
architecture_feature = set("arch-" + s for s in architectures)
801+
# Add device family features like intel-gpu-gen12, intel-gpu-dg2 based on
802+
# the architecture reported by sycl-ls.
803+
device_family = set(
804+
get_device_family_from_arch(arch)
805+
for arch in architectures
806+
if get_device_family_from_arch(arch) is not None
807+
)
808+
809+
# Print the detected GPU family name.
810+
if len(device_family) > 0:
811+
lit_config.note(
812+
"Detected GPU family for {}: {}".format(
813+
sycl_device, ", ".join(device_family)
814+
)
815+
)
816+
776817
features = set()
777818
features.update(aspect_features)
778819
features.update(sg_size_features)
779820
features.update(architecture_feature)
821+
features.update(device_family)
780822

781823
be, dev = sycl_device.split(":")
782824
features.add(dev.replace("fpga", "accelerator"))

0 commit comments

Comments
 (0)