Skip to content

Commit

Permalink
Merge pull request #905 from CHIP-SPV/fix-859-opencl-cpu-usm
Browse files Browse the repository at this point in the history
skip kernel annotation on CPU
  • Loading branch information
pvelesko authored Aug 12, 2024
2 parents b3fbd69 + 4c99463 commit a467bc6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:

push:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: [self-hosted, Linux, X64]
steps:
- uses: actions/checkout@v3
Expand All @@ -49,7 +48,7 @@ jobs:

cleanup:
needs: [build, push]
needs: [push]
runs-on: [self-hosted, Linux, X64]
steps:
- name: Clean up old Docker images
Expand Down
26 changes: 18 additions & 8 deletions scripts/unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function check_tests {
if ! grep -q "The following tests FAILED" "$file"; then
return 0
else
grep -q -E "The following tests FAILED:" -A 1000 "$file" | sed '/^$/q' | tail -n +2
grep -E "The following tests FAILED:" -A 1000 "$file" | sed '/^$/q' | tail -n +2
return 1
fi
}
Expand All @@ -183,15 +183,25 @@ set +e # disable exit on error

# Run tests for different configurations
run_tests igpu opencl
igpu_opencl_result=$(check_tests igpu_opencl_make_check_result.txt)
if [ "$host" = "salami" ]; then
exit $igpu_opencl_result
check_tests igpu_opencl_make_check_result.txt
igpu_opencl_exit_code=$?
exit $igpu_opencl_exit_code
fi
run_tests igpu level0
igpu_level0_result=$(check_tests igpu_level0_make_check_result.txt)
run_tests dgpu level0
dgpu_level0_result=$(check_tests dgpu_level0_make_check_result.txt)
run_tests dgpu opencl
dgpu_opencl_result=$(check_tests dgpu_opencl_make_check_result.txt)

exit $((igpu_opencl_result || dgpu_opencl_result || igpu_level0_result || dgpu_level0_result))
run_tests cpu opencl

check_tests igpu_opencl_make_check_result.txt
igpu_opencl_exit_code=$?
check_tests cpu_opencl_make_check_result.txt
cpu_opencl_exit_code=$?
check_tests dgpu_opencl_make_check_result.txt
dgpu_opencl_exit_code=$?
check_tests dgpu_level0_make_check_result.txt
dgpu_level0_exit_code=$?
check_tests igpu_level0_make_check_result.txt
igpu_level0_exit_code=$?

exit $((igpu_opencl_exit_code || dgpu_opencl_exit_code || igpu_level0_exit_code || dgpu_level0_exit_code || cpu_opencl_exit_code))
13 changes: 9 additions & 4 deletions src/backend/OpenCL/CHIPBackendOpenCL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ CHIPCallbackDataOpenCL::CHIPCallbackDataOpenCL(hipStreamCallback_t TheCallback,

// EventMonitorOpenCL
// ************************************************************************
EventMonitorOpenCL::EventMonitorOpenCL() : chipstar::EventMonitor(){};
EventMonitorOpenCL::EventMonitorOpenCL() : chipstar::EventMonitor() {};

Check warning on line 316 in src/backend/OpenCL/CHIPBackendOpenCL.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

src/backend/OpenCL/CHIPBackendOpenCL.cc:316:44 [readability-redundant-member-init]

initializer for base class 'chipstar::EventMonitor' is redundant

void EventMonitorOpenCL::monitor() {
logTrace("EventMonitorOpenCL::monitor()");
Expand Down Expand Up @@ -1263,8 +1263,13 @@ CHIPQueueOpenCL::launchImpl(chipstar::ExecItem *ExecItem) {
LOCK(Backend->DubiousLockOpenCL);
#endif

auto AllocationsToKeepAlive = annotateIndirectPointers(
*OclContext, Kernel->getModule()->getInfo(), KernelHandle);
std::unique_ptr<std::vector<std::shared_ptr<void>>> AllocationsToKeepAlive;
// Disable annotation for CPU device. Runtime errror.
// https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-Using-USM-on-Intel-CPU-Runtime-along-with/m-p/1621136#M7350
if (ChipEnvVars.getDevice().getType() != DeviceType::CPU) {
AllocationsToKeepAlive = annotateIndirectPointers(
*OclContext, Kernel->getModule()->getInfo(), KernelHandle);
}

auto [EventsToWait, EventLocks] = getSyncQueuesLastEvents(LaunchEvent, false);
std::vector<cl_event> SyncQueuesEventHandles = getOpenCLHandles(EventsToWait);
Expand Down Expand Up @@ -1409,7 +1414,7 @@ CHIPQueueOpenCL::memCopyAsyncImpl(void *Dst, const void *Src, size_t Size,
#ifdef CHIP_DUBIOUS_LOCKS
LOCK(Backend->DubiousLockOpenCL)
#endif
auto [EventsToWait, EventLocks] = getSyncQueuesLastEvents(Event, false);
auto [EventsToWait, EventLocks] = getSyncQueuesLastEvents(Event, false);
std::vector<cl_event> SyncQueuesEventHandles =
getOpenCLHandles(EventsToWait);
auto *Ctx = getContext();
Expand Down
16 changes: 16 additions & 0 deletions tests/known_failures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,20 @@ ANY:
CatchMemLeak1: ''
hipMemset_Unit_hipMemsetAsync_SetMemoryWithOffset_Helgrind: 'False positives from L0 helper thread'
OPENCL_CPU:
hipBlas-sgemm: 'GEMM SYCL exception: Backends mismatch'
2d_shuffle: ''
Unit_hipClassKernel_Value: ''
Unit_hipMemsetFunctional_PartialSet_1D: ''
fp16: ''
hipConstantTestDeviceSymbol: ''
hipDynamicShared2: ''
unroll: ''
Unit_hipMemsetAsync_VerifyExecutionWithKernel: 'Failed'
Unit_hipDeviceSynchronize_Functional: 'Failed'
Unit_hipTextureObj1DCheckRGBAModes - array: 'Timeout'
Unit_hipTextureObj1DCheckRGBAModes - buffer: 'Timeout'
Unit_hipTextureObj2DCheckRGBAModes: 'Failed'
hipMemset_Unit_hipMemsetAsync_SetMemoryWithOffset_Helgrind: 'Failed'
OPENCL_GPU:
Unit_hipEvent: ''
TestStlFunctionsDouble: ''
Expand Down Expand Up @@ -475,6 +482,15 @@ cupcake:
OPENCL_CPU:
OPENCL_GPU:
OPENCL_POCL:
meatloaf:
ALL:
Unit_hipMultiStream_sameDevice: 'Started randomly failing on CI node with CL_OUT_OF_RESOURCES'
Unit_hipStreamCreate_MultistreamBasicFunctionalities: 'Started randomly failing on CI node with CL_OUT_OF_RESOURCES'
Unit_hipDeviceSynchronize_Functional: 'Started randomly failing on CI node with CL_OUT_OF_RESOURCES'
LEVEL0_GPU:
OPENCL_CPU:
OPENCL_GPU:
OPENCL_POCL:
salami:
ALL:
LEVEL0_GPU:
Expand Down

0 comments on commit a467bc6

Please sign in to comment.