Skip to content

[SYCL][Driver] Add deprecated warning for backend GRF options on PVC #12029

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 5 commits into from
Dec 1, 2023

Conversation

sarnex
Copy link
Contributor

@sarnex sarnex commented Nov 28, 2023

With the -ftarget-register-alloc-mode option, the user doesn't need to pass IGC flags to the compiler to set the GRF mode. On PVC, emit a warning in the most common case to suggest the user use the new option. This doesn't catch every case because the -device syntax is complicated, but it can help in the most common use case.

@sarnex
Copy link
Contributor Author

sarnex commented Nov 29, 2023

HIP and CUDA failures are both

Failed Tests (1):
  SYCL :: Regression/vec_rel_swizzle_ops.cpp

and are not related and are under investigation.

// RUN: %clang -fsycl -Xs "-device pvc -ze-intel-128-GRF-per-thread" -### %s 2>&1 | FileCheck -check-prefix=SMALL %s
// RUN: %clang -fsycl -Xs "-ze-intel-enable-auto-large-GRF-mode -device pvc" -### %s 2>&1 | FileCheck -check-prefix=AUTO %s

// RUN: %clang -fsycl -fsycl-targets=intel_gpu_pvc -Xs "-ze-opt-large-register-file" -### %s 2>&1 | FileCheck -check-prefix=LARGE %s
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did I miss any important cases here?

Copy link
Contributor

Choose a reason for hiding this comment

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

So do we care about potential usages like -Xs -ze-opt-large-register-file -Xs "-device pvc"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

im gonna go with no because i've never seen anybody do that and it seems like it would be pretty annoying to deal with

// Make sure to only warn for once for gen targets as the translate
// options tree is called twice but only the second time has the
// device set.
if (Triple.isSPIR() && Triple.getSubArch() == llvm::Triple::SPIRSubArch_gen &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is kinda gross but we end up calling the entire translate backend opt tree super early in selectBfloatLibs so if we don't do anything the warning is thrown twice for the same backend opt instance.

Copy link
Contributor

Choose a reason for hiding this comment

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

this would probably need some kind of cleanup so we can do BE arg checking from anywhere and not be impacted by multiple diagnostic outputs, but yeah, it's not pretty.

@sarnex sarnex marked this pull request as ready for review November 29, 2023 21:21
@sarnex sarnex requested review from a team as code owners November 29, 2023 21:21
Comment on lines 23 to 25

int main() {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Actual source code not needed - everything is -### checked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice catch, thanks

// RUN: %clang -fsycl -Xs "-device pvc -ze-intel-128-GRF-per-thread" -### %s 2>&1 | FileCheck -check-prefix=SMALL %s
// RUN: %clang -fsycl -Xs "-ze-intel-enable-auto-large-GRF-mode -device pvc" -### %s 2>&1 | FileCheck -check-prefix=AUTO %s

// RUN: %clang -fsycl -fsycl-targets=intel_gpu_pvc -Xs "-ze-opt-large-register-file" -### %s 2>&1 | FileCheck -check-prefix=LARGE %s
Copy link
Contributor

Choose a reason for hiding this comment

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

So do we care about potential usages like -Xs -ze-opt-large-register-file -Xs "-device pvc"?

// Make sure to only warn for once for gen targets as the translate
// options tree is called twice but only the second time has the
// device set.
if (Triple.isSPIR() && Triple.getSubArch() == llvm::Triple::SPIRSubArch_gen &&
Copy link
Contributor

Choose a reason for hiding this comment

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

this would probably need some kind of cleanup so we can do BE arg checking from anywhere and not be impacted by multiple diagnostic outputs, but yeah, it's not pretty.

Signed-off-by: Sarnie, Nick <[email protected]>
@sarnex
Copy link
Contributor Author

sarnex commented Dec 1, 2023

@intel/dpcpp-cfe-reviewers Hey all, mind reviewing this one? Just added a warning in the td file.

@@ -399,6 +399,9 @@ def err_drv_fsycl_wrong_optimization_options : Error<
def warn_drv_fsycl_add_default_spec_consts_image_flag_in_non_AOT : Warning<
"-fsycl-add-default-spec-consts-image flag has an effect only in Ahead of Time Compilation mode (AOT).">,
InGroup<SyclTarget>;
def warn_drv_ftarget_register_alloc_mode_pvc : Warning<
"using %0 to set GRF mode on PVC hardware is deprecated; use -ftarget-register-alloc-mode=pvc:%1">,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"using %0 to set GRF mode on PVC hardware is deprecated; use -ftarget-register-alloc-mode=pvc:%1">,
"using '%0' to set GRF mode on PVC hardware is deprecated; use '-ftarget-register-alloc-mode=pvc:%1'">,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in latest commit, thank you!

Signed-off-by: Sarnie, Nick <[email protected]>
Signed-off-by: Sarnie, Nick <[email protected]>
@sarnex
Copy link
Contributor Author

sarnex commented Dec 1, 2023

@intel/dpcpp-devops-reviewers Cuda CI not looking too hot:

  Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy'
  nvidia-container-cli: requirement error: unsatisfied condition: cuda>=12.1, please update your driver to a newer version, or use an earlier cuda container: unknown

@sarnex
Copy link
Contributor Author

sarnex commented Dec 1, 2023

@intel/llvm-gatekeepers Can we merge this one? Cuda CI is failing but it passed in an earlier commit here and all I did since then is reword a warning which is tested in LIT and passes on other platforms.

@aelovikov-intel aelovikov-intel merged commit ea6a3a3 into intel:sycl Dec 1, 2023
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.

5 participants