快速入门

请用户先按照《安装指南》完成安装,再执行本文档内容。

性能测试

执行以下命令启动Embedding Lookup性能基准测试。

cd /path/to/monolith 
sh test.sh

终端将输出不同线程数(1/4/8/12/16/32)下的查表延迟(latency),用于评估优化效果。

性能测试结果如下:

Target //monolith/native_training/runtime/hash_table:hash_table_benchmark up-to-date:
bazel-bin/monolith/native_training/runtime/hash_table/hash_table_benchmark
INFO: Elapsed time: 25.750s, Critical Path: 20.97s
INFO: 502 processes: 502 local.
INFO: Build completed successfully, 506 total actions
INFO: Build completed successfully, 506 total actions
2025-04-06 16:15:14
Running /root/.cache/bazel/_bazel_root/dbf0f40e374fbc5aa6cac176dcb94747/execroot/main/bazel-out/aarch64-opt/bin/monolith/native_training/runtime/hash_table/hash_table_benchmark
Run on (384 X 2600 MHz CPU s)
CPU Caches:
L1 Data 64K (x192)
L1 Instruction 128K (x192)
L2 Unified 1024K (x192)
L3 Unified 23296K (x24)
Load Average: 12.74, 41.51, 120.19
WARNING CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0406 16:15:14.758088 419215 cuckoo_embedding_hash_table.cc:136] skip_zero_embedding: 0
Benchmark Time CPU Iterations
BM_Find/200000000/1/32 29205923557 ns 29205889200 ns 1
BM_Find/200000000/4/32 7452221632 ns 7451761660 ns 1
BM_Find/200000000/8/32 3865206003 ns 3864757590 ns 1
BM_Find/200000000/12/32 2643050194 ns 2643023170 ns 1
BM_Find/200000000/16/32 2075133562 ns 2075018770 ns 1
BM_Find/200000000/32/32 1806290150 ns 1805845290 ns 1

单元测试(UT)

验证功能正确性及环境配置是否正常。

cd /path/to/monolith
./bazel-3.4.0-linux-arm64 run --copt=-DENABLE_KP //monolith/native_training/runtime/hash_table/cuckoohash:cuckoo_embedding_hash_table_test

功能测试结果如下:

......
[----------] 2 tests from SkipZeroEmbedding/EmbeddingHashTableSkipZeroEmbeddingTest
[ RUN      ] SkipZeroEmbedding/EmbeddingHashTableSkipZeroEmbeddingTest.AssignSkipZeroEmbedding/0 
[       OK ] SkipZeroEmbedding/EmbeddingHashTableSkipZeroEmbeddingTest.AssignSkipZeroEmbedding/0 (30 ms)

Global test environment tear-down
[==========] 30 tests from 5 test suites ran.(12212 ms    total)
[  PASSED  ] 30 tests.

修订记录

发布日期 修订记录
2026-06-30 第一次正式发布。
基于开源的Monolith进行鲲鹏ARM平台的适配与优化。
鲲鹏BoostKit版本号:26.1.RC1