Skip to content

Commit 9813a47

Browse files
committed
Test: Default blocksize yields 3 blocks (NYC_Taxi)
1 parent adc6600 commit 9813a47

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
A LLVM-based compiler for LightGBM decision trees.
77

8-
`lleaves` converts trained LightGBM models to optimized machine code, speeding-up inference by ≥10x.
8+
`lleaves` converts trained LightGBM models to optimized machine code, speeding-up prediction by ≥10x.
99

1010
## Example
1111

@@ -51,9 +51,9 @@ mix of categorical and numerical features.
5151
|``lleaves`` | 5.90ms | 56.96ms | 388.88ms |
5252

5353
## Advanced usage
54-
To avoid any Python overhead during inference you can link against the generated binary.
55-
For an example of how to do this see `benchmarks/c_bench/`.
56-
The function signature might change between major versions.
54+
To avoid any Python overhead during prediction you can link directly against the generated binary.
55+
See `benchmarks/c_bench/` for an example of how to do this.
56+
The function signature can change between major versions.
5757

5858
## Development
5959
```bash

tests/test_compile_flags.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ def NYC_data():
2020
return feature_enginering().fit_transform(df).astype(np.float64)
2121

2222

23-
# we don't test the default, which is 34
24-
@pytest.mark.parametrize("blocksize", [1, 100])
23+
@pytest.mark.parametrize("blocksize", [1, 34, 100])
2524
def test_cache_blocksize(blocksize, NYC_data):
2625
llvm_model = Model(model_file="tests/models/NYC_taxi/model.txt")
2726
lgbm_model = Booster(model_file="tests/models/NYC_taxi/model.txt")
@@ -39,6 +38,12 @@ def test_cache_blocksize(blocksize, NYC_data):
3938
assert "instr-block-setup.1:" in stdout
4039
assert "instr-block-setup.99:" in stdout
4140
assert "instr-block-setup.100:" not in stdout
41+
if blocksize == 34:
42+
# NYC_taxi has 100 trees, hence blocksize 34 should create 3 blocks
43+
assert "instr-block-setup.1:" in stdout
44+
assert "instr-block-setup.2:" in stdout
45+
assert "instr-block-setup.3:" not in stdout
46+
assert "instr-block-setup.4:" not in stdout
4247
if blocksize == 100:
4348
assert "instr-block-setup.1:" not in stdout
4449
assert "instr-block-setup.2:" not in stdout

0 commit comments

Comments
 (0)