Skip to content

Conversation

@zhaomaosu
Copy link
Contributor

  • Update tests to make it more robust

* Update tests to make it more robust

Signed-off-by: Zhao, Maosu <maosu.zhao@intel.com>
@zhaomaosu zhaomaosu requested a review from a team as a code owner May 7, 2025 07:30
@zhaomaosu zhaomaosu temporarily deployed to WindowsCILock May 7, 2025 07:31 — with GitHub Actions Inactive
@zhaomaosu zhaomaosu requested a review from Copilot May 7, 2025 07:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the ThreadSanitizer tests and the runtime to treat each work item as a thread on the GPU and to improve robustness. Key changes include:

  • Removing the check_usm.cpp test file.
  • Updating several tests to use a larger ND-range (128, 8) and increasing buffer sizes.
  • Modifying the epoch increment and GPU thread model in tsan_rtl.cpp to treat each work item as a thread.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sycl/test-e2e/ThreadSanitizer/check_usm.cpp Removed obsolete test file.
sycl/test-e2e/ThreadSanitizer/check_unaligned_access.cpp Updated ND-range size from 32 to 128 for enhanced test robustness.
sycl/test-e2e/ThreadSanitizer/check_shared_usm.cpp Added test with updated ND-range and USM allocation for shared memory.
sycl/test-e2e/ThreadSanitizer/check_host_usm.cpp Added test with updated ND-range and USM allocation for host memory.
sycl/test-e2e/ThreadSanitizer/check_device_usm.cpp Added test with updated ND-range and USM allocation for device memory.
sycl/test-e2e/ThreadSanitizer/check_device_global.cpp Updated ND-range from 32 to 128 for global memory access race check.
sycl/test-e2e/ThreadSanitizer/check_buffer.cpp Increased static buffer size from 16 to 128.
sycl/test-e2e/ThreadSanitizer/check_access16.cpp Updated ND-range from 32 to 128 for improved test stability.
libdevice/sanitizer/tsan_rtl.cpp Adjusted epoch increment from atomicAdd to a post-increment operator and updated comment to reflect that each work item is now treated as a thread.
Comments suppressed due to low confidence (1)

libdevice/sanitizer/tsan_rtl.cpp:79

  • Replacing the call to atomicAdd with a post-increment operator may compromise atomicity and thread safety. Consider reverting to the atomicAdd function or ensuring that this update is safe in the GPU work item context.
return TsanLaunchInfo->Clock[sid].clk_[sid]++;

@zhaomaosu
Copy link
Contributor Author

Hi @intel/llvm-gatekeepers, this PR is ready to be merged. Thanks.

@sommerlukas sommerlukas merged commit 1a83e6e into intel:sycl May 8, 2025
24 checks passed
@zhaomaosu zhaomaosu deleted the tsan-fix-test branch May 8, 2025 07:42
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