Repository navigation
Conversation
Building the dataset with --num-workers below 1 cannot work: a zero-worker distributed Dask cluster never computes, so the build hangs; the local-scheduler path avoids the hang but set_task then divides the patient list by the worker count; a negative count dies inside Dask/torch loader construction with an error that never names the flag. The guard refuses below 1 up front. --no-dask-distributed does not make 0 workers work. Upstream behaviour is left alone: a workerless cluster and a zero divisor are the caller's mistake, and clamping inside BaseDataset would change shared semantics for every dataset. Zero is still allowed for loading a prebuilt sample dataset, which never touches the Dask path. Sources: DaskCluster/set_task code paths in pyhealth/datasets/base_dataset.py (read-only; unchanged). Tests: tests/core/test_unified_e2e_runner.py::TestUnifiedE2ERunner::test_num_workers_zero_refused_when_building (new;... Claude-Session: https://claude.ai/code/session_011iPyPDjj4ktrHDkPbEkk95
BaseDataset treats dev as a flag and hardcodes the 1000-patient cap in both the distributed and local paths, so --dev 5000 silently behaved as --dev 1000 while the help text promised N patients. The dataset is left alone; the runner refuses anything but 0 (off) and 1000 and the help text now says what the flag does. Sources: BaseDataset dev handling in pyhealth/datasets/base_dataset.py (read-only; unchanged). Tests: tests/core/test_unified_e2e_runner.py::TestUnifiedE2ERunner::test_dev_other_values_refused (new; fails without this commit). Claude-Session: https://claude.ai/code/session_011iPyPDjj4ktrHDkPbEkk95
Ablating a modality by switching --task changes the cohort and the split with it, so the arms are not comparable. --drop-modality (labs, notes; repeatable) instead filters the task input schema before set_task: same task, same samples, same split, same seed. Labs drops with its observation mask, notes drops the admission-note field; the cohort keeps every patient and a patient with nothing left in the remaining modality stays as an empty sequence, which the unified model already supports. Cohort selection, time origin, splits, and --note-root are unchanged -- the task still reads every table -- so dropping notes still needs --note-root. The run directory gains a _nolabs/_nonotes suffix so a drop arm cannot overwrite its reference. Dropping everything is refused. Sources: task input_schema/set_task wiring in pyhealth (read-only; unchanged). Tests: test_drop_modality_refusals and test_drop_modality_filters_task_schema (new; both fail without this commit). Claude-Session: https://claude.ai/code/session_011iPyPDjj4ktrHDkPbEkk95
Ablate-by-task-switch compared different cohorts (626 vs 737 samples at --dev 1000), the unpaired cross-task trap. ablate --modalities now uses the runner's --drop-modality: same task, same samples, same split, same seed, with the dropped arm's fields removed at the model stage. Dropping labs works now; dropping everything is refused by the runner's rule before any run. The unconditional 'seeds and splits identical' line is gone: the summary now checks seed, split sizes, and inference-split sample ids across arms and prints what matches, naming the arms that differ. The identity line reports what it compares: unique inference-split patient ids, with train/val splits and labels not compared; an empty predictions file reports not recorded, not "0 ids match". A passed-through --drop-modality is refused under ablate (the arms would silently replace it); the hardcoded toy-magnitudes line is gone from summary.md (it was false on real data); and the runner module loads once per driver run through a single cached loader. Backbone reachability comes from the runner's own wiring map instead of a mirrored table: --heads on JambaEHR is now correctly allowed (the runner passes it) and --num-layers on JambaEHR correctly refused (the runner never passes it). Sources: runner --drop-modality and _ARCH_FLAGS_USED (same branch). Tests: doctests in the module (5 passed); full driver suite in the next commit. Claude-Session: https://claude.ai/code/session_011iPyPDjj4ktrHDkPbEkk95
Sixteen pure checks (converters, arm construction, refusal paths, fake-run summaries with identical, differing, and empty predictions, the single cached runner loader) plus four real demo-fixture cases: one per mode on labs, and a notes ablation on notes_labs asserting identical splits and sample ids across arms with zero frozen-cache traffic in the dropped arm. Tests: tests/core/test_unified_experiments.py (20 passed: 16 unit and 4 demo-fixture, CPU; the notes case needs the t... Claude-Session: https://claude.ai/code/session_011iPyPDjj4ktrHDkPbEkk95
Three modes, same-task ablations through --drop-modality, the computed seed/split/identity check in summary.md, and the small utilities a user reaches for (cache counters, worker and Dask options, dev-mode honesty). The pasted numbers are a real demo-fixture sweep, labeled toy magnitudes. Tests: README only; the pasted CSV schema is pinned by the driver summary tests. Claude-Session: https://claude.ai/code/session_011iPyPDjj4ktrHDkPbEkk95
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Draft. The experiment driver for Tranche 1, in 6 small commits, stacked on #57. This diff holds only these 6 commits, so #56 and #57 should land first. Upstream master has since moved to
0181aa2f; this layer stays on59890580for review.Items 1 to 3 are upstream candidates (the
--num-workers,--devand--drop-modalitychanges). Items 4 to 6 are the experiment driver and its tests and docs, not yet marked as upstream candidates. Please use the Commits tab: each commit makes one change and has its own tests.Commits
--num-workers 0fails before the dataset is built--devvalues are refused, instead of silently running as 1000Please read before reviewing
BaseDatasettreatsdevas a flag and caps at 1000 patients on both paths. The refusal is the change; the cap itself is unchanged.--taskchanges the cohort and the split with it, so those arms are not comparable. The driver now uses--drop-modalityon the same task.Verification
tools/check_pr_rules.pypasses on each commit (exit 0, ruff 0.17.6), each run with that commit checked out.59890580: upstream 16 failed, 4165 passed; this tip8f77dbb8: 13 failed, 4356 passed. The failing-test diff has no new failures. The only differences are the three upstreamtests/core/test_lime.pyfailures (TestLimeExplainerStageNet), which pass on this tip. LIME is randomized and flaky in both directions (see Tranche 1: 29 commits for commit-by-commit review #56).Not in this PR
https://claude.ai/code/session_011iPyPDjj4ktrHDkPbEkk95