conda env create -f environment.yml
conda activate autocompSet your API key before running search:
export OPENAI_API_KEY="your_openai_api_key"If you use gated Hugging Face models, log in first:
huggingface-cli loginDatabase-building scripts require CUDA GPUs.
Run a lightweight check without GPUs or API calls:
python tests/smoke_test.pyOptionally test local Hugging Face model loading and one forward pass:
AUTOCOMP_SMOKE_MODEL="Qwen/Qwen2.5-3B-Instruct" python tests/smoke_test.pyEach supported model has two scripts:
- Build the pruning database.
- Run search and benchmark the top 3 policies.
bash scripts/build_db_llama31_8b.sh
bash scripts/search_benchmark_llama31_8b.shbash scripts/build_db_qwen25_3b.sh
bash scripts/search_benchmark_qwen25_3b.shbash scripts/build_db_qwen25_7b.sh
bash scripts/search_benchmark_qwen25_7b.shbash scripts/build_db_mistral_nemo_12b.sh
bash scripts/search_benchmark_mistral_nemo_12b.shbash scripts/build_db_olmoe_1b7b.sh
bash scripts/search_benchmark_olmoe_1b7b.shOverride defaults with environment variables:
MODEL="meta-llama/Llama-3.1-8B" \
DB_PATH="db_output/llama31_8b/Llama-3.1-8B" \
RUN_ROOT="outputs/llama31_8b" \
TARGET_FLOPS_REDUCTION=0.5 \
AGENT_MODEL="gpt-5-mini" \
AGENT_STEPS=40 \
bash scripts/search_benchmark_llama31_8b.shUseful variables:
MODEL: model name or local model path.DB_PATH: pruning database path.RUN_ROOT: output directory.TARGET_FLOPS_REDUCTION: target compression ratio.AGENT_MODEL: OpenAI model for policy search.AGENT_STEPS: number of search rounds.CUDA_VISIBLE_DEVICES: GPUs to use.NPROC_PER_NODE: number of processes for database building.PYTHON_BIN: Python executable used by scripts.TORCHRUN_BIN: torchrun executable used by database-building scripts.ALLOW_CPU_BUILD: set to1only for tiny CPU debugging runs withNPROC_PER_NODE=1.
Search scripts write:
RUN_ROOT/search_result.json
RUN_ROOT/best_policy.json
RUN_ROOT/debug_trace.json
RUN_ROOT/policies/top1_policy.json
RUN_ROOT/policies/top2_policy.json
RUN_ROOT/policies/top3_policy.json
RUN_ROOT/benchmarks/top1_benchmark_results.json
RUN_ROOT/benchmarks/top2_benchmark_results.json
RUN_ROOT/benchmarks/top3_benchmark_results.json