Skip to content

[SYCL][Matrix] Fix __spirv_JointMatrixINTEL signature #6957

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 8 commits into from
Oct 11, 2022

Conversation

MrSidims
Copy link
Contributor

@MrSidims MrSidims commented Oct 4, 2022

Default SYCL_EXT_ONEAPI_MATRIX to 1

Added SYCL_EXT_ONEAPI_MATRIX_VERSION to differentiate API versions.

Only add 'Use' parameter if testing macro SYCL_EXT_ONEAPI_MATRIX_VERSION = 2
is defined.

Signed-off-by: Sidorov, Dmitry [email protected]

@MrSidims MrSidims requested a review from a team as a code owner October 4, 2022 11:47
@MrSidims MrSidims requested a review from romanovvlad October 4, 2022 11:47
@MrSidims MrSidims requested a review from dkhaldi October 4, 2022 11:48
@MrSidims MrSidims force-pushed the private/MrSidims/FixMatrixUseTypename2 branch 2 times, most recently from b68041e to 63f6307 Compare October 4, 2022 12:16
@@ -22,11 +22,20 @@
#endif

#ifdef __SYCL_DEVICE_ONLY__

#if SYCL_EXT_ONEAPI_MATRIX == 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please clarify where this macro is defined? I've got an impression that the macro should be defined to some specific value in our headers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Default SYCL_EXT_ONEAPI_MATRIX to 1

Only add 'Use' parameter if testing macro __SYCL_EXT_ONEAPI_MATRIX_USE__
is defined.

Signed-off-by: Sidorov, Dmitry <[email protected]>
@MrSidims MrSidims force-pushed the private/MrSidims/FixMatrixUseTypename2 branch from 63f6307 to 17b81ff Compare October 5, 2022 11:49
#if (SYCL_EXT_ONEAPI_MATRIX == 1)
#include <sycl/ext/oneapi/matrix/matrix-jit.hpp>
#include <sycl/ext/oneapi/matrix/static-query.hpp>
#if (SYCL_EXT_ONEAPI_MATRIX == 3)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JackAKirk it doesn't look like a correct usage of SYCL_EXT_ONEAPI_MATRIX (users shouldn't pass such macro during compilation, see #6662 (comment) ). What would be an appropriate replacement for it?

Copy link
Contributor

@JackAKirk JackAKirk Oct 5, 2022

Choose a reason for hiding this comment

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

There isn't an intention of using any macro in the future in order to decide the APIs to use. Initially for the initial Tensor Cores experimental implementation we followed the existing pattern used by the AOT and JIT intel implementations by setting a new value to the feature test macro. The SYCL spec itself doesn't appear to forbid this, although it sounds like the extension document itself contradicts the implementation in this regard!

We plan to add a separate macro analogous to SYCL_EXT_ONEAPI_MATRIX_LEGACY_API. We could name it SYCL_EXT_ONEAPI_MATRIX_LEGACY_CUDA_API for example.
Since the interfaces for the combined Intel/CUDA implementation has been decided I could also open a PR that supports both Intel and CUDA backends within the same implementation. #5920 is blocked on a spirv builtin atm, so it sounds like we shouldn't wait on this PR before starting the combined implementation. We could add the macro for the legacy version at the same time.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just talked with @dkhaldi, and it sounds like she prefers to have a different name for the macro that chooses the API.

Signed-off-by: Sidorov, Dmitry <[email protected]>
Signed-off-by: Sidorov, Dmitry <[email protected]>
Signed-off-by: Sidorov, Dmitry <[email protected]>
@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 5, 2022

/verify

@MrSidims MrSidims requested a review from gmlueck October 5, 2022 15:37
@MrSidims MrSidims closed this Oct 5, 2022
@MrSidims MrSidims reopened this Oct 5, 2022
@MrSidims MrSidims requested a review from romanovvlad October 6, 2022 11:37
Signed-off-by: Sidorov, Dmitry <[email protected]>
@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 6, 2022

/verify with intel/llvm-test-suite#1311

Copy link
Contributor

@dkhaldi dkhaldi left a comment

Choose a reason for hiding this comment

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

LGTM

@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 6, 2022

/verify with intel/llvm-test-suite#1311

@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 6, 2022

It does look like verify with doesn't attach tests from llvm-test-suite, so will try to do testing from an opposite direction.

@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 7, 2022

@romanovvlad could you please take one more look? I can't tell for sure, why 'verify with' is failing for CUDA in this PR. At the same time in intel/llvm-test-suite#1311 CUDA tests are passing with this PR attached.

@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 7, 2022

@intel/llvm-gatekeepers could you please take a look and merge?
(should be merged together with intel/llvm-test-suite#1311 )

@pvchupin
Copy link
Contributor

pvchupin commented Oct 7, 2022

@romanovvlad could you please take one more look? I can't tell for sure, why 'verify with' is failing for CUDA in this PR. At the same time in intel/llvm-test-suite#1311 CUDA tests are passing with this PR attached.

CUDA doesn't run in "verify with" mode. Have you checked tests modifications locally on CUDA?

@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 10, 2022

@romanovvlad could you please take one more look? I can't tell for sure, why 'verify with' is failing for CUDA in this PR. At the same time in intel/llvm-test-suite#1311 CUDA tests are passing with this PR attached.

CUDA doesn't run in "verify with" mode. Have you checked tests modifications locally on CUDA?

No, I didn't . I've just tried and in both cases with and without the patch the tests are failing to compile. Trying to figure out, what else is missing.

I would assume that the fact of successful compilation of the tests is good enough since CUDA is only affected by modification of a macro.

Signed-off-by: Sidorov, Dmitry <[email protected]>
@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 10, 2022

Made an NFC update for exceptions' messages.
@pvchupin on the machine with CUDA I was able to compile device-code of the tests successfully (and only device code is affected by the changes and there is no difference in IR before and after the patch but clang version metadata, so it's good enough).
Though wasn't able to execute the binaries yet. I would still need to learn, how to work with CUDA properly, but meanwhile, can we merged these 2 PRs?

@MrSidims
Copy link
Contributor Author

Made an NFC update for exceptions' messages. @pvchupin on the machine with CUDA I was able to compile device-code of the tests successfully (and only device code is affected by the changes and there is no difference in IR before and after the patch but clang version metadata, so it's good enough). Though wasn't able to execute the binaries yet. I would still need to learn, how to work with CUDA properly, but meanwhile, can we merged these 2 PRs?

With a help from Steffen was able to compile not only the device code, but all the test. All went fine. Execution though actually requires something like A1000 to run AMX code.

@pvchupin pvchupin merged commit 775d068 into intel:sycl Oct 11, 2022
pvchupin pushed a commit to intel/llvm-test-suite that referenced this pull request Oct 11, 2022
…SION (#1311)

[SYCL][Matrix] Replace SYCL_EXT_ONEAPI_MATRIX with SYCL_EXT_ONEAPI_MATRIX_VERSION

Related to intel/llvm#6957

Signed-off-by: Sidorov, Dmitry <[email protected]>
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Feb 23, 2023
…SION (intel#1311)

[SYCL][Matrix] Replace SYCL_EXT_ONEAPI_MATRIX with SYCL_EXT_ONEAPI_MATRIX_VERSION

Related to intel#6957

Signed-off-by: Sidorov, Dmitry <[email protected]>
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
…SION (intel/llvm-test-suite#1311)

[SYCL][Matrix] Replace SYCL_EXT_ONEAPI_MATRIX with SYCL_EXT_ONEAPI_MATRIX_VERSION

Related to intel#6957

Signed-off-by: Sidorov, Dmitry <[email protected]>
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.

6 participants