Skip to content

[XPTI] 64-bit universal ID rework to use a tuple of three 64-bit components #4318

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 9 commits into from
Aug 15, 2021

Conversation

tovinkere
Copy link
Contributor

With the requirement of supporting 64-bit hash generation from code location+line number or kernel name + back trace + address or kernel name + address, the universal ID manages three 64-bit values representing each of these scenarios to generate a hash. Updated the unit tests and performance tests to use the new data structure and hash generation algorithm, including a simulation of 10000-1000000 million trace points that result in no collision.

o Added new XPTI data type uid_t that will be
  used to generate the universal 64-bit ID
o Added std::less/std::hash specialization to
  support map/unorder_maps with uid_t as keys
o Added unit tests to verify

Signed-off-by: Vasanth Tovinkere <[email protected]>
Old Universal ID generated a 64-hash from source
file string ID, line number, kernel name string
ID and code pointer. The new approach will create
an Universal ID structure with three 64-bit values
that are created from source file string ID, line
number, stack back trace string ID from caller/
callee, kernnel name string ID and code pointer.
The 64-bit hash is a bijection of the available
values.

- Updates the internal data structures to eliminate
  data structures that mapped payload information
  64-hash to universal ID
- Reduces the number of data stuctures
- Updates the unit tests to reflect the infrastucture
  changes

Signed-off-by: Vasanth Tovinkere <[email protected]>
@tovinkere tovinkere requested a review from alexbatashev August 11, 2021 21:45
@tovinkere tovinkere requested a review from andykaylor as a code owner August 11, 2021 21:45
@tovinkere tovinkere changed the title [XPTI] 64-bit universal ID rework to used a tuple of thre 64-bit components [XPTI] 64-bit universal ID rework to used a tuple of three 64-bit components Aug 11, 2021
@tovinkere tovinkere changed the title [XPTI] 64-bit universal ID rework to used a tuple of three 64-bit components [XPTI] 64-bit universal ID rework to use a tuple of three 64-bit components Aug 11, 2021
Signed-off-by: Vasanth Tovinkere <[email protected]>
Copy link
Contributor

@alexbatashev alexbatashev left a comment

Choose a reason for hiding this comment

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

Amazing work!

Signed-off-by: Vasanth Tovinkere <[email protected]>
alexbatashev
alexbatashev previously approved these changes Aug 12, 2021
+ Universal ID needs to be available for use as a
key in std::map and this requires std::less
understanding this type or the type supporting
operator<(). Removing the std::less implementation
as the object already supports operator<(). Add unit
tests to see if the std::map insertions are ordered.

Signed-off-by: Vasanth Tovinkere <[email protected]>
Copy link
Contributor

@andykaylor andykaylor left a comment

Choose a reason for hiding this comment

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

I just have a few minor comments. You can ignore them if you don't have anything else to change.

@@ -52,6 +52,6 @@ endif()

# The tests in basic_test are written using TBB, so these tests are enabled
# only if TBB has been enabled.
if (XPTI_ENABLE_TBB)
if (0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment explaining why this is unconditionally disabled and when that might change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, TBB is required for exercising multi-threaded tests and marginal performance improvement of some data structure access in multi-threaded mode. However, XPTI does not require TBB to be fully functional. The reason for disabling this feature is that the Windows builds have a failure while linking the multi-threaded tests and once we resolve them, we should be able to turn them on.

Payload->uid.p2 = XPTI_PACK32_RET64(stack_id, name_id);
// The code pointer for the kernel is already in 64-bit format
if ((Payload->flags &
static_cast<uint64_t>(payload_flag_t::CodePointerAvailable)))
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you have an extra set of parentheses here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Will address in the next PR as it is cosmetic.

@bader bader merged commit a201984 into intel:sycl Aug 15, 2021
@tovinkere tovinkere deleted the xpti_key branch April 19, 2024 20:50
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.

4 participants