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

Implement Dynamic Local Accessors #16573

Open
wants to merge 10 commits into
base: sycl
Choose a base branch
from

Conversation

fabiomestre
Copy link
Contributor

@fabiomestre fabiomestre commented Jan 9, 2025

Implements the dynamic_local_accessor class which adds functionality to update local_accessors in sycl graph nodes. See reble#382 for API spec.

UR PR oneapi-src/unified-runtime#2559 is also required for testing to pass

@fabiomestre fabiomestre force-pushed the fabio/dynamic_local_accessor_impl branch from 897dbb6 to c7fba1a Compare January 14, 2025 15:32
@fabiomestre fabiomestre force-pushed the fabio/dynamic_local_accessor_impl branch from c0587c9 to 9acfb29 Compare January 14, 2025 16:26
@fabiomestre fabiomestre force-pushed the fabio/dynamic_local_accessor_impl branch from 5a47f11 to 4824925 Compare January 15, 2025 12:48
@fabiomestre fabiomestre force-pushed the fabio/dynamic_local_accessor_impl branch from 2467538 to d6964ff Compare January 15, 2025 15:32
@fabiomestre fabiomestre marked this pull request as ready for review January 15, 2025 17:23
@fabiomestre fabiomestre requested review from a team as code owners January 15, 2025 17:24
@fabiomestre fabiomestre requested a review from a team as a code owner January 15, 2025 17:24
@fabiomestre fabiomestre force-pushed the fabio/dynamic_local_accessor_impl branch from f13c1ec to 5c58995 Compare January 15, 2025 17:47
Copy link
Contributor

@EwanC EwanC left a comment

Choose a reason for hiding this comment

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

LGTM

assert(check_value(i, Ref, HostDataAfterUpdate[i], "PtrA After Update"));
}

free(PtrA, Queue);
Copy link
Contributor

Choose a reason for hiding this comment

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

can free PtrB too

command_graph<graph_state::modifiable> Graph, const property_list &PropList)
: impl(std::make_shared<dynamic_parameter_impl>(
sycl::detail::getSyclObjImpl(Graph))) {
checkGraphPropertiesAndThrow(PropList);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required for dynamic parameters? This checks for graph properties but any properties passed here should be dynamic_parameter properties (if/when they exist).

// Weak ptrs to node_impls which will be updated
std::vector<std::pair<std::weak_ptr<node_impl>, int>> MNodes;
// Dynamic command-groups which will be updated
std::vector<DynamicCGInfo> MDynCGs;

std::shared_ptr<graph_impl> MGraph;
std::vector<std::byte> MValueStorage;

std::unordered_map<std::shared_ptr<sycl::detail::handler_impl>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could use a comment here explaining the purpose of this map.

@@ -3524,14 +3528,14 @@ _ZN4sycl3_V17handler20associateWithHandlerEPNS0_6detail30UnsampledImageAccessorB
_ZN4sycl3_V17handler20memcpyToDeviceGlobalEPKvS3_bmm
_ZN4sycl3_V17handler20setKernelCacheConfigENS1_23StableKernelCacheConfigE
_ZN4sycl3_V17handler20setStateSpecConstSetEv
_ZN4sycl3_V17handler21setKernelWorkGroupMemEm
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this symbol hasn't changed but simply moved in the ordering, I've been advised previously to remove such changes from PRs (or submit them as a separate PR) to aid in reviewing these changes.

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