Skip to content

enable GPU IPC tests on Windows - #739

Merged
bratpiorka merged 1 commit into
oneapi-src:mainfrom
bratpiorka:rrudnick_ipc_win
Oct 16, 2025
Merged

enable GPU IPC tests on Windows#739
bratpiorka merged 1 commit into
oneapi-src:mainfrom
bratpiorka:rrudnick_ipc_win

Conversation

@bratpiorka

@bratpiorka bratpiorka commented Sep 18, 2024

Copy link
Copy Markdown
Contributor

This PR enables GPU IPC (Inter-Process Communication) tests on Windows by implementing Windows-specific socket functionality and memory exchange mechanisms. The changes introduce a new memory exchange policy for Level Zero providers to work around IPC limitations on Windows.

Key changes:

  • Implements Windows socket support in IPC test infrastructure using Winsock2
  • Adds new memory exchange policy (import/export) for Level Zero providers on Windows
  • Creates Windows batch scripts for running GPU IPC tests

@bratpiorka
bratpiorka force-pushed the rrudnick_ipc_win branch 5 times, most recently from 6da36e1 to da553d7 Compare September 19, 2024 08:08
@bratpiorka
bratpiorka force-pushed the rrudnick_ipc_win branch 3 times, most recently from a77f891 to 78361c2 Compare September 16, 2025 14:49
@bratpiorka bratpiorka changed the title enable IPC tests and examples on Windows enable GPU IPC tests and examples on Windows Sep 16, 2025
@bratpiorka
bratpiorka force-pushed the rrudnick_ipc_win branch 6 times, most recently from 976028a to cfc6f31 Compare September 17, 2025 08:27
@bratpiorka bratpiorka changed the title enable GPU IPC tests and examples on Windows enable GPU IPC tests on Windows Sep 17, 2025
@bratpiorka
bratpiorka marked this pull request as ready for review September 17, 2025 12:03
@bratpiorka
bratpiorka requested a review from a team as a code owner September 17, 2025 12:03
Comment thread test/providers/ipc_cuda_prov.bat Outdated
Comment thread test/common/ipc_common.c

@lukaszstolarczuk lukaszstolarczuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

good job in general, a few minor issues

Comment thread test/CMakeLists.txt Outdated
Comment thread test/CMakeLists.txt Outdated
Comment thread test/CMakeLists.txt
Comment thread test/common/ipc_common.c
@bratpiorka
bratpiorka force-pushed the rrudnick_ipc_win branch 7 times, most recently from d0aca41 to becaa7d Compare September 17, 2025 18:36

@lukaszstolarczuk lukaszstolarczuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@lplewa lplewa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update examples/documentation/readme(?)

Comment thread test/providers/ipc_cuda_prov.bat Outdated
@@ -0,0 +1,38 @@
@echo off

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please write this in python so we do not add extra technical dept.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines +86 to +100
typedef enum umf_level_zero_memory_provider_memory_exchange_policy_t {
UMF_LEVEL_ZERO_MEMORY_PROVIDER_MEMORY_EXCHANGE_POLICY_IPC =
0, ///< Memory exchange policy based on IPC. Default.
UMF_LEVEL_ZERO_MEMORY_PROVIDER_MEMORY_EXCHANGE_POLICY_IMPORT_EXPORT,
///< Memory exchange policy based on import/export APIs. Should be used if IPC exchange policy is not supported.
} umf_level_zero_memory_provider_memory_exchange_policy_t;

/// @brief Set the memory exchange policy.
/// @param hParams handle to the parameters of the Level Zero Memory Provider.
/// @param policy memory exchange policy.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t umfLevelZeroMemoryProviderParamsSetMemoryExchangePolicy(
umf_level_zero_memory_provider_params_handle_t hParams,
umf_level_zero_memory_provider_memory_exchange_policy_t policy);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this is temporary hack for IPC on windows, i whould like to export this api as CTL, at least for now.

CTL is experimental, so we do not commit to this feature etc....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@bratpiorka
bratpiorka force-pushed the rrudnick_ipc_win branch 3 times, most recently from 73e747a to 384c4c4 Compare October 10, 2025 13:03
@bratpiorka
bratpiorka marked this pull request as draft October 10, 2025 13:04
@bratpiorka
bratpiorka force-pushed the rrudnick_ipc_win branch 10 times, most recently from b12a5d7 to e3cfa20 Compare October 14, 2025 10:01
@bratpiorka

Copy link
Copy Markdown
Contributor Author

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

@bratpiorka

Copy link
Copy Markdown
Contributor Author

@lplewa please re-review

@lplewa lplewa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Documentation and examples are missing

Comment on lines +88 to +94
typedef enum umf_level_zero_memory_provider_memory_exchange_policy_t {
UMF_LEVEL_ZERO_MEMORY_PROVIDER_MEMORY_EXCHANGE_POLICY_IPC =
0, ///< Memory exchange policy based on IPC. Default.
UMF_LEVEL_ZERO_MEMORY_PROVIDER_MEMORY_EXCHANGE_POLICY_IMPORT_EXPORT,
///< Memory exchange policy based on import/export APIs. Should be used if IPC exchange policy is not supported.
} umf_level_zero_memory_provider_memory_exchange_policy_t;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of this enum - can we at least mark it as experimental as it is related to experimental CTL api?

IMHO best if CTL api just work on int - and we do not have this enum at all TBH

Comment thread src/provider/provider_level_zero.c Outdated
void *ctx, umf_ctl_query_source_t source, void *arg, size_t size,
umf_ctl_index_utlist_t *indexes) {
/* suppress unused-parameter errors */
(void)source, (void)indexes, (void)size;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Check size if it's correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread src/provider/provider_level_zero.c Outdated
void *ctx, umf_ctl_query_source_t source, void *arg, size_t size,
umf_ctl_index_utlist_t *indexes) {
/* suppress unused-parameter errors */
(void)source, (void)indexes, (void)size;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Check size if it's correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

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