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

Remove old umf leftovers #2214

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
build_type: [Debug, Release]
compiler: [{c: gcc, cxx: g++}]
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF']
pool_tracking: ['-DUMF_ENABLE_POOL_TRACKING=ON', '-DUMF_ENABLE_POOL_TRACKING=OFF']
latency_tracking: ['-DUR_ENABLE_LATENCY_HISTOGRAM=OFF']
include:
- os: 'ubuntu-22.04'
Expand Down Expand Up @@ -96,7 +95,6 @@ jobs:
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
-DUR_CONFORMANCE_TEST_LOADER=OFF
${{matrix.libbacktrace}}
${{matrix.pool_tracking}}
${{matrix.latency_tracking}}

- name: Configure CMake
Expand All @@ -114,7 +112,6 @@ jobs:
-DUR_FORMAT_CPP_STYLE=OFF
-DUR_DEVELOPER_MODE=OFF
${{matrix.libbacktrace}}
${{matrix.pool_tracking}}
${{matrix.latency_tracking}}

- name: Build
Expand All @@ -127,7 +124,7 @@ jobs:

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "loader|validation|tracing|unit|urtrace"

fuzztest:
name: Fuzz tests short
Expand Down Expand Up @@ -278,7 +275,7 @@ jobs:

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "loader|validation|tracing|unit|urtrace"

macos-build:
name: Build - MacOS
Expand Down Expand Up @@ -309,6 +306,6 @@ jobs:
-DCMAKE_BUILD_TYPE=Release
-DUR_BUILD_TESTS=ON
-DUR_FORMAT_CPP_STYLE=ON
-DUMF_ENABLE_POOL_TRACKING=ON

- name: Build
run: cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
sudo apt-get install -y libhwloc-dev

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_ENABLE_TRACING=ON -DUR_BUILD_TOOLS=ON -DUMF_ENABLE_POOL_TRACKING=ON
run: cmake -B ${{github.workspace}}/build -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_ENABLE_TRACING=ON -DUR_BUILD_TOOLS=ON

- name: Build
run: cmake --build ${{github.workspace}}/build -j $(nproc)
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Configure CMake
env:
VCPKG_PATH: "C:/vcpkg/packages/hwloc_x64-windows"
run: cmake -B ${{github.workspace}}/build -DCMAKE_POLICY_DEFAULT_CMP0094=NEW -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_ENABLE_TRACING=ON -DUR_BUILD_TOOLS=ON -DUMF_ENABLE_POOL_TRACKING=ON -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
run: cmake -B ${{github.workspace}}/build -DCMAKE_POLICY_DEFAULT_CMP0094=NEW -DUR_DEVELOPER_MODE=ON -DUR_BUILD_TESTS=ON -DUR_ENABLE_TRACING=ON -DUR_BUILD_TOOLS=ON -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"

- name: Build
run: cmake --build ${{github.workspace}}/build -j $(nproc) --config Release
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
-DUR_ENABLE_TRACING=ON
-DUR_DEVELOPER_MODE=ON
-DUR_BUILD_TESTS=ON
-DUMF_ENABLE_POOL_TRACKING=ON
-DUR_FORMAT_CPP_STYLE=ON
-DCMAKE_BUILD_TYPE=Debug
-DUR_BUILD_ADAPTER_L0=ON
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ option(UR_ENABLE_TRACING "enable api tracing through xpti" OFF)
option(UR_ENABLE_SANITIZER "enable device sanitizer" ON)
option(UR_ENABLE_SYMBOLIZER "enable symoblizer for sanitizer" OFF)
option(UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" ON)
option(UMF_ENABLE_POOL_TRACKING "Build UMF with pool tracking" ON)
option(UR_BUILD_ADAPTER_L0 "Build the Level-Zero adapter" OFF)
option(UR_BUILD_ADAPTER_OPENCL "Build the OpenCL adapter" OFF)
option(UR_BUILD_ADAPTER_CUDA "Build the CUDA adapter" OFF)
Expand Down
6 changes: 0 additions & 6 deletions source/adapters/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ else()
)
endif()

if(UMF_ENABLE_POOL_TRACKING)
target_compile_definitions("ur_adapter_cuda" PRIVATE UMF_ENABLE_POOL_TRACKING)
else()
message(WARNING "CUDA adapter USM pools are disabled, set UMF_ENABLE_POOL_TRACKING to enable them")
endif()

if (UR_ENABLE_TRACING)
include(FindCUDACupti)
# The following two ifs can be removed when FindCUDA -> FindCUDAToolkit.
Expand Down
8 changes: 0 additions & 8 deletions source/adapters/cuda/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate(
///< ::ur_usm_pool_limits_desc_t
ur_usm_pool_handle_t *Pool ///< [out] pointer to USM memory pool
) {
// Without pool tracking we can't free pool allocations.
#ifdef UMF_ENABLE_POOL_TRACKING
if (PoolDesc->flags & UR_USM_POOL_FLAG_ZERO_INITIALIZE_BLOCK) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Expand All @@ -454,12 +452,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate(
return Ex.getError();
}
return UR_RESULT_SUCCESS;
#else
std::ignore = Context;
std::ignore = PoolDesc;
std::ignore = Pool;
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
#endif
}

UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolRetain(
Expand Down
8 changes: 0 additions & 8 deletions source/adapters/hip/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate(
///< ::ur_usm_pool_limits_desc_t
ur_usm_pool_handle_t *Pool ///< [out] pointer to USM memory pool
) {
// Without pool tracking we can't free pool allocations.
#ifdef UMF_ENABLE_POOL_TRACKING
Copy link
Contributor

@frasercrmck frasercrmck Oct 22, 2024

Choose a reason for hiding this comment

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

Last time I checked, UMF_ENABLE_POOL_TRACKING was disabled in HIP (note the lack of CMake adding the compile definitions). Has something changed such that we're able to enable pool tracking by default in HIP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

och, I've missed that, thanks for the review! On the other hand, the CI is green... so either we have some magic in testing or it works as expected... let me verify that further

Copy link
Contributor

Choose a reason for hiding this comment

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

I forget what the specific problem was, but IIRC only some versions of HIP were having problems. See #1479 and #1689. I couldn't make much progress with it just ended up prioritising something else, but I see in my notes that I put it down to HIP 5.7.1 crashing in CI (at the time) whereas locally 6.0+ was okay.

I don't know what we're testing in CI these days, I'm afraid.

Copy link
Contributor

@GeorgeWeb GeorgeWeb Oct 28, 2024

Choose a reason for hiding this comment

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

Also, we don't run HIP E2E testing for DPC++, so I wonder if that's something we ought to verify too tho unlikely to happen since it looks like the Precommit CI for that target is not running in intel/llvm atm.
I am unaware what the UMF tracking problems with HIP were and I presume the passing CI, based on Fraser's previous observations, could be due to testing newer version of HIP these days.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've rebased that old PR of mine, just in case it is able to provide some more context/data about what's going on.

Copy link
Contributor

@GeorgeWeb GeorgeWeb Oct 28, 2024

Choose a reason for hiding this comment

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

Hey @lukaszstolarczuk
This PR #1689 removes some more USMAlloc tests from the match files and they seem to fail with enabled memory pools (via UMF_ENABLE_POOL_TRACKING). Maybe they should remain as known failures for now and we still have memory pools enabled by default but I am not sure of any implications.
I think I'll use yours and @frasercrmck's best judgement on this matter.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think, given that this PR is not NFC for HIP, we should see some changes to the match files. The PR description should also reflect this. If there are still failures in the USM tests with this PR (as I suspect there will be, given the problems I had on my PR) then we need to account for them somehow. This might be tricky given that CI isn't currently testing a supported GPU.

if (PoolDesc->flags & UR_USM_POOL_FLAG_ZERO_INITIALIZE_BLOCK) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Expand All @@ -397,12 +395,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate(
return Ex.getError();
}
return UR_RESULT_SUCCESS;
#else
std::ignore = Context;
std::ignore = PoolDesc;
std::ignore = Pool;
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
#endif
}

UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolRetain(
Expand Down