Expose protobuf CLI training and compression tuning flags#830
Conversation
|
Hi @REASY! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Expose protobuf CLI training and compression tuning flags
Summary
This PR exposes a few existing protobuf CLI tuning knobs so
protobuf_clican be used for reproducible benchmarking and compression tuning:serialize --compression-level <level>benchmark --compression-level <level>train --trainer greedy|bottom-up|full-splittrain --threads <n>train --max-time-secs <seconds>The default behavior is unchanged when these flags are not provided.
Motivation
The protobuf CLI already supports training and serializing protobuf payloads, but several important tuning parameters were only reachable from code defaults. That makes it hard to compare OpenZL behavior across compression levels, trainer choices, thread counts, or bounded training budgets.
These flags are useful for:
--threads;--max-time-secs;Changes
Compression level
Adds
ProtoSerializer::setCompressionLevel(int level), which forwards to:The protobuf CLI now applies this setting for:
Trainer selection
Adds CLI parsing for the existing
training::ClusteringTrainervariants:Training controls
Adds CLI flags that map to existing
training::TrainParamsfields:Backward Compatibility
All new flags are optional.
Existing invocations continue to use the same defaults as before:
No serialization format changes are introduced.
Example
Testing
Built
protobuf_clisuccessfully with:cmake \ -S . \ -B build \ -DCMAKE_BUILD_TYPE=Release \ -DOPENZL_BUILD_PROTOBUF_TOOLS=ON cmake --build build --target protobuf_cli -j 8