Skip to content

Commit 4885393

Browse files
authored
[bugfix] bugfix in ucmnfsstore (#123)
* trans task timeout support * [Fix] posix file open interface bugfix
1 parent f659e16 commit 4885393

File tree

19 files changed

+421
-319
lines changed

19 files changed

+421
-319
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
2+
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
3+
name: ucmnfsstore-ut
4+
5+
on:
6+
push:
7+
branches: [ "dev*", "main", "*release" ]
8+
pull_request:
9+
branches: [ "dev*", "main", "*release" ]
10+
11+
env:
12+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
13+
BUILD_TYPE: Debug
14+
15+
jobs:
16+
ci:
17+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
18+
# You can convert this to a matrix build if you need cross-platform coverage.
19+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install googletest
26+
run: |
27+
git clone https://github.com/google/googletest.git --depth=1 --branch=release-1.11.0
28+
cd googletest
29+
mkdir build && cd build
30+
cmake -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=True ..
31+
sudo make install -j
32+
33+
- name: Install mockcpp
34+
run: |
35+
git clone https://github.com/sinojelly/mockcpp.git --depth=1
36+
cd mockcpp
37+
mkdir build && cd build
38+
cmake -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=True -DMOCKCPP_XUNIT="gtest" -DMOCKCPP_XUNIT_HOME=/usr/local/ ..
39+
sudo make install -j
40+
41+
- name: Configure CMake
42+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
43+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
44+
working-directory: ${{github.workspace}}/unifiedcache/csrc/ucmnfsstore
45+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON -DCOVERAGE_ENABLED=ON -DDOWNLOAD_DEPENDENCE=ON -DRUNTIME_ENVIRONMENT=simu
46+
47+
- name: Build
48+
# Build your program with the given configuration
49+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
50+
51+
- name: Test
52+
working-directory: ${{github.workspace}}/build
53+
# Execute tests defined by the CMake configuration.
54+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
55+
run: ctest -C ${{env.BUILD_TYPE}}

test/dump_and_load_on_dram.py

Lines changed: 0 additions & 130 deletions
This file was deleted.

test/dump_and_load_on_hbm.py

Lines changed: 0 additions & 146 deletions
This file was deleted.

unifiedcache/csrc/ucmnfsstore/cc/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ set(UCMNFSSTORE_CUDA_CC_SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/domain/device/cu
33
set(UCMNFSSTORE_ASCEND_CC_SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/domain/device/aclrt_device.cc)
44
list(REMOVE_ITEM UCMNFSSTORE_CC_SOURCE_FILES ${UCMNFSSTORE_CUDA_CC_SOURCE_FILE} ${UCMNFSSTORE_ASCEND_CC_SOURCE_FILE})
55
if(RUNTIME_ENVIRONMENT STREQUAL "ascend")
6-
include(${CMAKE_SOURCE_DIR}/cmake/ascend.cmake)
6+
include(${UCMNFSSTORE_ROOT}/cmake/ascend.cmake)
77
list(APPEND UCMNFSSTORE_CC_SOURCE_FILES ${UCMNFSSTORE_ASCEND_CC_SOURCE_FILE})
88
set(DEVICE_LIBRARY Ascend::ascendcl)
99
endif()
1010
if(RUNTIME_ENVIRONMENT STREQUAL "cuda")
11-
include(${CMAKE_SOURCE_DIR}/cmake/cuda.cmake)
11+
include(${UCMNFSSTORE_ROOT}/cmake/cuda.cmake)
1212
list(APPEND UCMNFSSTORE_CC_SOURCE_FILES ${UCMNFSSTORE_CUDA_CC_SOURCE_FILE})
1313
set(DEVICE_LIBRARY Cuda::cudart)
1414
endif()

unifiedcache/csrc/ucmnfsstore/cc/api/ucmnfsstore/ucmnfsstore.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ void ShowSetupParam(const SetupParam& param)
4040
UC_INFO("Set UC::StreamNumber to {}.", param.transferStreamNumber);
4141
UC_INFO("Set UC::IOSize to {}.", param.transferIoSize);
4242
UC_INFO("Set UC::BufferNumber to {}.", param.transferBufferNumber);
43+
UC_INFO("Set UC::TimeoutMs to {}.", param.transferTimeoutMs);
4344
}
4445

4546
int32_t Setup(const SetupParam& param)
@@ -53,7 +54,7 @@ int32_t Setup(const SetupParam& param)
5354
if (param.transferEnable) {
5455
auto taskMgr = Singleton<TsfTaskManager>::Instance();
5556
status = taskMgr->Setup(param.transferDeviceId, param.transferStreamNumber, param.transferIoSize,
56-
param.transferBufferNumber, spaceMgr->GetSpaceLayout());
57+
param.transferBufferNumber, param.transferTimeoutMs, spaceMgr->GetSpaceLayout());
5758
if (status.Failure()) {
5859
UC_ERROR("Failed({}) to setup TsfTaskManager.", status);
5960
return status.Underlying();

unifiedcache/csrc/ucmnfsstore/cc/api/ucmnfsstore/ucmnfsstore.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ class SetupParam {
4040
size_t transferStreamNumber;
4141
size_t transferIoSize;
4242
size_t transferBufferNumber;
43+
size_t transferTimeoutMs;
4344

4445
public:
4546
SetupParam(const std::vector<std::string>& storageBackends, const size_t kvcacheBlockSize,
4647
const bool transferEnable)
4748
: storageBackends{storageBackends}, kvcacheBlockSize{kvcacheBlockSize}, transferEnable{transferEnable},
48-
transferDeviceId{-1}, transferStreamNumber{32}, transferIoSize{262144}, transferBufferNumber{512}
49+
transferDeviceId{-1}, transferStreamNumber{32}, transferIoSize{262144}, transferBufferNumber{512},
50+
transferTimeoutMs{30000}
4951
{
5052
}
5153
};

0 commit comments

Comments
 (0)