Download loopq_quantization/scripts/loopq/experiment_contract.py from JunYoungLee/ut-depth-probe-artifacts: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/JunYoungLee/ut-depth-probe-artifacts/resolve/main/loopq_quantization/scripts/loopq/experiment_contract.py
- Command line
-
hf download hf://JunYoungLee/ut-depth-probe-artifacts/loopq_quantization/scripts/loopq/experiment_contract.py
-
curl -L -o experiment_contract.py https://huggingface.co/JunYoungLee/ut-depth-probe-artifacts/resolve/main/loopq_quantization/scripts/loopq/experiment_contract.py
1.07 kB
| """Shared, explicit experiment identities; a study is not Table-1 calibration.""" | |
| STUDY_SAMPLES = (16, 32, 64, 128, 256, 512, 1024, 2048) | |
| FIGURE6_SAMPLES = (32, 64, 128, 256, 512, 1024, 2048) | |
| SLT_BUDGETS = (0, 2, 4, 8) | |
| def calibration_identity(*, smoke: bool, samples: int, study_samples: bool, | |
| budget: int, ablation: str | None) -> dict: | |
| if samples <= 0 or budget not in SLT_BUDGETS: | |
| raise ValueError("invalid sample count or SLT budget") | |
| expected_budget = 0 if ablation == "no_slt" else 4 | |
| studies = [] | |
| if study_samples: | |
| if samples not in STUDY_SAMPLES: | |
| raise ValueError("unsupported calibration-size study") | |
| studies.append("calibration_size") | |
| if budget != expected_budget: | |
| studies.append("slt_budget") | |
| paper = not smoke and not studies and samples == 1024 | |
| return dict(paper_calibration=paper, study={"axes": studies, "samples": samples, | |
| "slt_budget": budget} if studies else None, | |
| run_kind="smoke" if smoke else "study" if studies else "paper_profile") | |