Skip to content
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

[SYCL][E2E] Remove build-and-run-mode feature and run-mode ignore line filtering workaround #17023

Draft
wants to merge 6 commits into
base: sycl
Choose a base branch
from

Conversation

ayylol
Copy link
Contributor

@ayylol ayylol commented Feb 14, 2025

Removes the build-and-run-mode feature from e2e lit infrastructure, as well as the remaining REQUIRES: build-and-run-mode markups found in tests. Also removes the run-only mode ignore line filtering workaround on REQUIRES: build-and-run-mode. For tests that still need to be ran completely on the run-only side (mainly AOT tests), explicitly mark the compilation lines with %{run-aux}

@@ -2,9 +2,8 @@
// using fp64 can be compiled AOT.

// REQUIRES: ocloc, opencl-aot, any-device-is-cpu
// REQUIRES: build-and-run-mode
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s
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 I'd prefer to use %{run-aux} on all build lines in most cases if we need it at one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can do that. My initial reasoning for this is that the rest of the build lines are never ran so we could get away with building them just once on the build system.


// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -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.

Do we really require the device to be present when building for specific HW? That looks strange.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I understand the reason that the AOT cpu tests compile fine, but fail on the run stage is that the test is built for the specific cpu architecture of the build machine, which may be different than that of the run system. If we passed in an architecture to opencl-aot with the --march option we could possibly get around this, but then we would need to make sure we are running the correct executable, based on the run-systems cpu architecture.

Copy link
Contributor

Choose a reason for hiding this comment

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

But we are compiling for a specific gpu here, aren't we?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm, the following line is wrapped in %if cpu and the test has "cpu" in its title? am I missing something here?

Copy link
Contributor

Choose a reason for hiding this comment

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

These two lines seem to compile for AOT GPU + SPIR-V JIT, and then execute on CPU via JIT compilation. The execution scenario is similar to play %{build}/%{run}.

Lines 11 does need run-aux because it AOT compiles for host CPU, so we need that to be executed during "run" stage.

@@ -1,10 +1,9 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
//
// RUN: %if any-device-is-cpu && opencl-aot %{ %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %}
// RUN: %if any-device-is-cpu && opencl-aot %{ %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with limited run-aux usage here though.

@@ -107,7 +107,7 @@ jobs:
image: ${{ matrix.image }}
image_options: ${{ matrix.image_options }}
target_devices: ${{ matrix.target_devices }}
extra_lit_opts: --param fallback-to-build-if-requires-build-and-run=True ${{ matrix.extra_lit_opts }}
extra_lit_opts: ${{ matrix.extra_lit_opts }}
Copy link
Contributor

Choose a reason for hiding this comment

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

is my understanding that the basic idea of this PR is to merge the build-and-test mode with the run mode, so we build all tests that can't be built in build mode in the run mode?

Copy link
Contributor Author

@ayylol ayylol Feb 14, 2025

Choose a reason for hiding this comment

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

Main motivation is to remove the build-and-run-mode feature, which was just introduced as a way to temporarily mark tests as not available for the split build/run mode while we figured out how to properly react to requires/unsupported statements.

The remaining tests that had this markup (which are all changed in this pr) had not yet had that requirement removed because they either never ran on CI and have regular build failures, or were AOT cpu tests and if we build these on a seperate machine we end up building for that machine's cpu architecture which if it is different than the run system's architecture it causes execution failures.

The fallback-to-build-if-requires-build-and-run option is also removed since that option only functions when a test has REQUIRES: build-and-run-mode

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.

3 participants