From 5bbb16254dd59c52fe4038a25ffd8fa32a5561f6 Mon Sep 17 00:00:00 2001 From: Florent Pollet Date: Tue, 1 Dec 2026 09:07:55 -0500 Subject: [PATCH] Implementation prompt: standard MEDS tooling, full-scale efficiency, progress logging The prompt left preprocessing entirely to the algorithm and said nothing about scale or progress. Curiosity then reimplemented tokenization by hand, passed every fixture and demo gate, and on NWICU ran out of GPU memory twice, needed 29 min per prediction time in generation and logged nothing during a 26 h pretraining. - Prefer MEDS-Transforms stages and meds-torch-data for standard steps when the source has no usable pipeline; keep algorithm-specific representations in the algorithm package and record the choice. - Write expensive paths for full-data scale; project each step's full-data cost from a timed realistic slice before launching; the demo report includes it. - Stream aggregate-only progress logs from long steps. Both point to the template guide sections (MEDS_algorithm_template#56, #57). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NJQdbHt5icm1CgFVHsHTNx --- docs/implementation-prompt.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/implementation-prompt.md b/docs/implementation-prompt.md index 9224403..4782960 100644 --- a/docs/implementation-prompt.md +++ b/docs/implementation-prompt.md @@ -173,7 +173,21 @@ Preserve all selected algorithm profiles and standardized command arguments, MED manifest envelopes, MEDS-DEV model.yaml interface, and final MEDS prediction output. Intermediate payload formats and execution mechanisms are algorithm-owned: choose whatever preprocessing, featurization, framework, batching or non-batching strategy, external executable, storage format, and algorithm architecture most -faithfully reproduce the source. +faithfully reproduce the source. When the source has no usable pipeline of its own, prefer standard MEDS tooling +for standard steps over bespoke code: MEDS-Transforms stages (code filtering, normalization, quantile binning, +time-delta tokens) and meds-torch-data for tensorized loading, pinned like any dependency. Keep +algorithm-specific representations in the algorithm package and record which steps use which tool. + +Write the expensive paths (training, inference, generation, featurization) for the full dataset, not the +fixture: reuse shared work (prefix/prompt caches, last-position outputs), batch to available memory, avoid +per-item Python loops and host-device synchronizations in inner loops, run inference in the training dtype with +fused kernels, bound memory by the longest realistic input, and keep results independent of batch size. Before +any full-data launch, time a realistic slice and project each step's full-data cost (time per unit x units, peak +memory) in IMPLEMENTATION_REPORT.md; optimize or ask when it exceeds the approved resources. Long-running steps +stream progress through logging (phases with planned sizes, step out of total, training and tuning loss, +inference counts): aggregates and configuration only, never subject IDs, times, codes, values, labels, +predictions or sample rows. docs/IMPLEMENTATION_GUIDE.md ("Progress logging", "Efficiency at realistic scale") +gives the details. When predicates are needed, reuse MEDS-DEV predicates for the selected dataset if available; otherwise, use reviewed external predicates for that dataset and record their provenance. Decide within the algorithm @@ -230,7 +244,8 @@ predicate interpretation, and the proposed MIMIC-IV demo execution. Only after a There must be zero algorithm_stub skips. Report exact pass/skip counts and account for every remaining skip. Update IMPLEMENTATION_REPORT.md with the demo cohort, final-output coverage, predicate provenance, -environment, wall time, peak process-tree PSS/RSS, GPU measurements when available, failures, and fixes. +environment, wall time, peak process-tree PSS/RSS, GPU measurements when available, failures, fixes, and +each step's projected full-data cost. Ask for a second human review before launching the selected full dataset through the repository's SLURM interface. Review target-dataset compatibility, access, and resources separately from the MIMIC-IV demo. Use the supplied, already prepared task bundle for the selected dataset. It must contain task configs,