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

[HIP] Hip adapter multi dev ctx #999

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

hdelan
Copy link
Contributor

@hdelan hdelan commented Oct 26, 2023

Moving intel/llvm#11105 into UR repo with a few changes. Depends on #961

The getter func for ptrs/arrays/surfaces now allocates lazily if needed. This has made code a lot cleaner.

@hdelan hdelan requested review from a team as code owners October 26, 2023 10:39
@hdelan hdelan requested review from jchlanda and npmiller October 26, 2023 10:43
source/ur/ur.hpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need to sync changes to this file with the changes in #997

@jchlanda
Copy link
Contributor

Are you sure this is only multi device context, some of the changes look familiar, maybe the std::variant instead of union got mixed in?

@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch from 864294c to ebdb923 Compare October 26, 2023 10:54
@kbenzie
Copy link
Contributor

kbenzie commented Oct 26, 2023

Are you sure this is only multi device context, some of the changes look familiar, maybe the std::variant instead of union got mixed in?

If this is dependant on the std::variant changes, this should be marked draft until those merge.

@hdelan
Copy link
Contributor Author

hdelan commented Oct 26, 2023

Are you sure this is only multi device context, some of the changes look familiar, maybe the std::variant instead of union got mixed in?

This depends on the std::variant stuff so I have included the commit. Once that gets merged then I will rebase and the diff will be smaller. You could maybe wait on reviewing this until that merges

@hdelan hdelan marked this pull request as draft October 26, 2023 10:55
@jchlanda
Copy link
Contributor

Are you sure this is only multi device context, some of the changes look familiar, maybe the std::variant instead of union got mixed in?

This depends on the std::variant stuff so I have included the commit. Once that gets merged then I will rebase and the diff will be smaller. You could maybe wait on reviewing this until that merges

Sure, will do. Consider marking PR as draft if they are not ready for review.

@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch from ebdb923 to 263d84b Compare October 27, 2023 14:23
@@ -1 +1,2 @@
urContextCreateWithNativeHandleTest.Success/AMD_HIP_BACKEND___{{.*}}_
urContextGetInfoTestWithInfoParam.Success/AMD_HIP_BACKEND___{{.*}}
Copy link
Contributor Author

@hdelan hdelan Oct 27, 2023

Choose a reason for hiding this comment

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

The size of the Devices returned has changed as we now have a vector of devices. Whereas before we just had a pointer. This is backend specific so I think maybe just keep this as failing for now

urMemGetInfoTest.InvalidNullPointerPropSizeRet/AMD_HIP_BACKEND___{{.*}}
urMemGetInfoTest.InvalidNullPointerPropSizeRet/AMD_HIP_BACKEND___{{.*}}
urMemImageCreateTest.InvalidSize/AMD_HIP_BACKEND___{{.*}}
urMemImageGetInfoTest.Success/AMD_HIP_BACKEND___{{.*}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These MemImageGetInfos are unsupported

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like this test needs to allow these being unsupported. I can look into that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK great. Will I change this .match or just add a TODO?

Copy link
Contributor

Choose a reason for hiding this comment

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

I expect it'll be a separate PR so this line will need to stay in the .match file in order to pass testing. I don't actually know if these .match files support comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

#1144 is the PR that will address this CTS issue. Can resolve this discussion, I think.

urMemGetInfoTest.InvalidNullPointerParamValue/AMD_HIP_BACKEND___{{.*}}
urMemGetInfoTest.InvalidNullPointerPropSizeRet/AMD_HIP_BACKEND___{{.*}}
urMemGetInfoTest.InvalidNullPointerPropSizeRet/AMD_HIP_BACKEND___{{.*}}
urMemImageCreateTest.InvalidSize/AMD_HIP_BACKEND___{{.*}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how to deal with this thing. Perhaps we need to query the max image width depth etc when a device is initialized so we can check vals against this at Image creation

urMemBufferCreateWithNativeHandleTest.Success/AMD_HIP_BACKEND___{{.*}}_
Segmentation fault
urMemGetInfoTest.Success/AMD_HIP_BACKEND___{{.*}}
urMemGetInfoTest.InvalidNullPointerParamValue/AMD_HIP_BACKEND___{{.*}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are returning early in the adapter, see here https://github.com/oneapi-src/unified-runtime/blob/adapters/source/loader/layers/validation/ur_valddi.cpp#L1350 so the adapter entry point is never called

@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch from 263d84b to 32419b6 Compare October 27, 2023 14:30
@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch 2 times, most recently from cf65a5d to 3743e6c Compare November 1, 2023 09:55
@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch 6 times, most recently from b4bd0f4 to b811c86 Compare November 2, 2023 15:16
@hdelan hdelan marked this pull request as ready for review November 2, 2023 15:20
@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch from b811c86 to 8de5817 Compare November 2, 2023 15:46
Copy link
Contributor

@jchlanda jchlanda left a comment

Choose a reason for hiding this comment

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

That's quite a heavy lifting you've done here, well done!

@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch from 285e286 to 7e975e9 Compare November 10, 2023 10:11
@hdelan hdelan added the ready to merge Added to PR's which are ready to merge label Nov 15, 2023
@kbenzie
Copy link
Contributor

kbenzie commented Nov 24, 2023

The merge conflicts will need to be resolve.

@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch 2 times, most recently from 5ab1690 to 3934569 Compare November 24, 2023 18:13
@hdelan
Copy link
Contributor Author

hdelan commented Nov 24, 2023

@kbenzie have rebased

@hdelan
Copy link
Contributor Author

hdelan commented Nov 24, 2023

intel/llvm#11739 DPC++ PR here

@hdelan hdelan closed this Nov 27, 2023
@hdelan hdelan reopened this Nov 27, 2023
@hdelan hdelan force-pushed the hip-adapter-multi-dev-ctx branch from 3934569 to 7118ac6 Compare December 1, 2023 16:18
@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fe2735a) 15.79% compared to head (f0e0be2) 15.79%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##           adapters     #999   +/-   ##
=========================================
  Coverage     15.79%   15.79%           
=========================================
  Files           223      223           
  Lines         31351    31351           
  Branches       3511     3511           
=========================================
  Hits           4951     4951           
  Misses        26349    26349           
  Partials         51       51           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@kbenzie kbenzie left a comment

Choose a reason for hiding this comment

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

Couple of warnings treated as errors causing the GHA failure.

@hdelan
Copy link
Contributor Author

hdelan commented Dec 4, 2023

Oops thanks for that @kbenzie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Added to PR's which are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants