Skip to content

Commit c37c6de

Browse files
committed
Remove test for lrb and 3l
1 parent dbacecb commit c37c6de

4 files changed

Lines changed: 29 additions & 12 deletions

File tree

.github/workflows/python.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ jobs:
1616
- name: Prepare
1717
run: bash scripts/install_dependency.sh
1818

19-
- name: Install XGBoost and LightGBM
20-
run: |
21-
pip install xgboost lightgbm
22-
# Set environment variables to help CMake find the libraries
23-
echo "XGBOOST_ROOT=$(python -c 'import xgboost; print(xgboost.__file__)')" >> $GITHUB_ENV
24-
echo "LIGHTGBM_ROOT=$(python -c 'import lightgbm; print(lightgbm.__file__)')" >> $GITHUB_ENV
25-
2619
- name: Install Python dependencies
2720
run: |
2821
pip install --upgrade pip

libCacheSim-python/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ else()
113113
endif()
114114

115115
# Only include sources if dependencies are available
116-
if(ENABLE_XGBOOST)
116+
if(ENABLE_LIGHTGBM)
117117
file(GLOB_RECURSE LRB_SOURCES
118118
"${CMAKE_CURRENT_SOURCE_DIR}/../libCacheSim/cache/eviction/LRB/*.cpp"
119119
)
@@ -123,6 +123,10 @@ if(ENABLE_XGBOOST)
123123
else()
124124
set(LRB_SOURCES "")
125125
set(3L_CACHE_SOURCES "")
126+
127+
# disable the features
128+
add_compile_definitions(ENABLE_3L_CACHE=0)
129+
add_compile_definitions(ENABLE_LRB=0)
126130
endif()
127131

128132
file(GLOB_RECURSE CACHE_CPP_SOURCES

libCacheSim-python/src/pylibcachesim.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ PYBIND11_MODULE(_libcachesim, m) {
277277
Cache: A new FIFO cache instance.
278278
)pbdoc");
279279

280+
#ifdef ENABLE_LRB
280281
/**
281282
* @brief Create a LRB cache instance.
282283
*/
@@ -298,6 +299,15 @@ PYBIND11_MODULE(_libcachesim, m) {
298299
Returns:
299300
Cache: A new LRB cache instance.
300301
)pbdoc");
302+
#else
303+
// TODO(haocheng): add a dummy function to avoid the error when LRB is not enabled
304+
m.def(
305+
"LRB_init",
306+
[](uint64_t cache_size, std::string objective) {
307+
throw std::runtime_error("LRB is not enabled");
308+
},
309+
py::arg("cache_size"), py::arg("objective") = "byte-miss-ratio");
310+
#endif
301311

302312
/**
303313
* @brief Create a LRU cache instance.
@@ -372,6 +382,7 @@ PYBIND11_MODULE(_libcachesim, m) {
372382
Cache: A new Sieve cache instance.
373383
)pbdoc");
374384

385+
#ifdef ENABLE_3L_CACHE
375386
/**
376387
* @brief Create a ThreeL cache instance.
377388
*/
@@ -394,6 +405,15 @@ PYBIND11_MODULE(_libcachesim, m) {
394405
Returns:
395406
Cache: A new ThreeL cache instance.
396407
)pbdoc");
408+
#else
409+
// TODO(haocheng): add a dummy function to avoid the error when ThreeLCache is not enabled
410+
m.def(
411+
"ThreeLCache_init",
412+
[](uint64_t cache_size, std::string objective) {
413+
throw std::runtime_error("ThreeLCache is not enabled");
414+
},
415+
py::arg("cache_size"), py::arg("objective") = "byte-miss-ratio");
416+
#endif
397417

398418
/**
399419
* @brief Create a TinyLFU cache instance.

libCacheSim-python/tests/test_eviction.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
FIFO,
1515
ARC,
1616
Clock,
17-
LRB,
17+
# LRB,
1818
LRU,
1919
S3FIFO,
2020
Sieve,
21-
ThreeLCache,
21+
# ThreeLCache,
2222
TinyLFU,
2323
TwoQ,
2424
])
@@ -45,11 +45,11 @@ def test_eviction_algo(eviction_algo, cache_size_ratio, mock_reader):
4545
"FIFO",
4646
"ARC",
4747
"Clock",
48-
"LRB",
48+
# "LRB",
4949
"LRU",
5050
"S3FIFO",
5151
"Sieve",
52-
"3LCache",
52+
# "3LCache",
5353
"TinyLFU",
5454
"TwoQ",
5555
])

0 commit comments

Comments
 (0)