Add optional output directory compression for inference runs #544
+19
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces an option to compress the inference output directory, which is useful for large-scale prediction workloads that generate extensive results.
Compression only occurs after a full inference run completes.
If only the data pipeline is executed, no compression takes place, even if the compression flag is set to
true.The default behavior,
--compress_output_dir=falsepreserves existing functionality.Motivation
Inference runs can generate large output directories, especially in high-throughput scenarios. This option helps users:
Key Changes
Added
--compress_output_dirflag to the pipeline configuration (default:false).Behavioral logic:
Impact
✅ No breaking changes; default behavior unchanged
✅ Enables disk-saving via post-inference compression
✅ Explicitly avoids compression during data-only runs
Checklist
Example Output Directory Structure
To illustrate the effect of the new
--compress_output_dirflag, here is a snippet of the output directory tree generated during testing:tree results/ results/ ├── rule_DATA_PIPELINE │ ├── compress_false_inference_false_data_pipeline_true │ │ └── 2PV7 │ │ └── 2PV7_data.json │ ├── compress_false_inference_true_data_pipeline_false │ │ └── 2PV7 │ │ ├── 2PV7_confidences.json │ │ ├── 2PV7_data.json │ │ ├── 2PV7_model.cif │ │ ├── 2PV7_ranking_scores.csv │ │ ├── 2PV7_summary_confidences.json │ │ ├── seed-1_sample-0 │ │ │ ├── 2PV7_seed-1_sample-0_confidences.json │ │ │ ├── 2PV7_seed-1_sample-0_model.cif │ │ │ └── 2PV7_seed-1_sample-0_summary_confidences.json │ │ ├── seed-1_sample-1 │ │ │ ├── 2PV7_seed-1_sample-1_confidences.json │ │ │ ├── 2PV7_seed-1_sample-1_model.cif │ │ │ └── 2PV7_seed-1_sample-1_summary_confidences.json │ │ ├── seed-1_sample-2 │ │ │ ├── 2PV7_seed-1_sample-2_confidences.json │ │ │ ├── 2PV7_seed-1_sample-2_model.cif │ │ │ └── 2PV7_seed-1_sample-2_summary_confidences.json │ │ ├── seed-1_sample-3 │ │ │ ├── 2PV7_seed-1_sample-3_confidences.json │ │ │ ├── 2PV7_seed-1_sample-3_model.cif │ │ │ └── 2PV7_seed-1_sample-3_summary_confidences.json │ │ ├── seed-1_sample-4 │ │ │ ├── 2PV7_seed-1_sample-4_confidences.json │ │ │ ├── 2PV7_seed-1_sample-4_model.cif │ │ │ └── 2PV7_seed-1_sample-4_summary_confidences.json │ │ └── TERMS_OF_USE.md │ ├── compress_true_inference_false_data_pipeline_true │ │ └── 2PV7 │ │ └── 2PV7_data.json │ └── compress_true_inference_true_data_pipeline_false │ └── 2PV7.tar.gz ├── rule_DATA_PIPELINE_PLUS_INFERENCE │ ├── compress_false_inference_true_data_pipeline_true │ │ └── 2PV7 │ │ ├── 2PV7_confidences.json │ │ ├── 2PV7_data.json │ │ ├── 2PV7_model.cif │ │ ├── 2PV7_ranking_scores.csv │ │ ├── 2PV7_summary_confidences.json │ │ ├── seed-1_sample-0 │ │ │ ├── 2PV7_seed-1_sample-0_confidences.json │ │ │ ├── 2PV7_seed-1_sample-0_model.cif │ │ │ └── 2PV7_seed-1_sample-0_summary_confidences.json │ │ ├── seed-1_sample-1 │ │ │ ├── 2PV7_seed-1_sample-1_confidences.json │ │ │ ├── 2PV7_seed-1_sample-1_model.cif │ │ │ └── 2PV7_seed-1_sample-1_summary_confidences.json │ │ ├── seed-1_sample-2 │ │ │ ├── 2PV7_seed-1_sample-2_confidences.json │ │ │ ├── 2PV7_seed-1_sample-2_model.cif │ │ │ └── 2PV7_seed-1_sample-2_summary_confidences.json │ │ ├── seed-1_sample-3 │ │ │ ├── 2PV7_seed-1_sample-3_confidences.json │ │ │ ├── 2PV7_seed-1_sample-3_model.cif │ │ │ └── 2PV7_seed-1_sample-3_summary_confidences.json │ │ ├── seed-1_sample-4 │ │ │ ├── 2PV7_seed-1_sample-4_confidences.json │ │ │ ├── 2PV7_seed-1_sample-4_model.cif │ │ │ └── 2PV7_seed-1_sample-4_summary_confidences.json │ │ └── TERMS_OF_USE.md │ └── compress_true_inference_true_data_pipeline_true │ └── 2PV7.tar.gz └── rule_INFERENCE ├── compress_false_inference_true_data_pipeline_false │ └── 2PV7 │ ├── 2PV7_confidences.json │ ├── 2PV7_data.json │ ├── 2PV7_model.cif │ ├── 2PV7_ranking_scores.csv │ ├── 2PV7_summary_confidences.json │ ├── seed-1_sample-0 │ │ ├── 2PV7_seed-1_sample-0_confidences.json │ │ ├── 2PV7_seed-1_sample-0_model.cif │ │ └── 2PV7_seed-1_sample-0_summary_confidences.json │ ├── seed-1_sample-1 │ │ ├── 2PV7_seed-1_sample-1_confidences.json │ │ ├── 2PV7_seed-1_sample-1_model.cif │ │ └── 2PV7_seed-1_sample-1_summary_confidences.json │ ├── seed-1_sample-2 │ │ ├── 2PV7_seed-1_sample-2_confidences.json │ │ ├── 2PV7_seed-1_sample-2_model.cif │ │ └── 2PV7_seed-1_sample-2_summary_confidences.json │ ├── seed-1_sample-3 │ │ ├── 2PV7_seed-1_sample-3_confidences.json │ │ ├── 2PV7_seed-1_sample-3_model.cif │ │ └── 2PV7_seed-1_sample-3_summary_confidences.json │ ├── seed-1_sample-4 │ │ ├── 2PV7_seed-1_sample-4_confidences.json │ │ ├── 2PV7_seed-1_sample-4_model.cif │ │ └── 2PV7_seed-1_sample-4_summary_confidences.json │ └── TERMS_OF_USE.md └── compress_true_inference_true_data_pipeline_false └── 2PV7.tar.gz 32 directories, 68 files