Skip to content

Commit 2f826ad

Browse files
ryan-williamsclaude
andcommitted
Fix benchmark: use symlinked data root for subsampling, disable file size filter
Subsampled filelist needs its own data root (with symlinks to volume data/label dirs) since `run_training` reads `mp_filelist.txt` from the data root. Default `max_file_size=0` (no filter) since dataset_4 files fit in L4 VRAM. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f0e8c4a commit 2f826ad

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

modal/benchmark.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def run_benchmark(
6262
channels: int = 32,
6363
residual_blocks: int = 16,
6464
samples: int = 50,
65-
max_file_size: float = 25,
65+
max_file_size: float = 0,
6666
seed: int = 42,
6767
wandb_project: str = "elf-net-ci",
6868
gpu_type: str = "L4",
@@ -80,14 +80,20 @@ def run_benchmark(
8080
# Subsample from volume filelist if requested
8181
filelist = Path(DATA_ROOT) / "mp_filelist.txt"
8282
all_ids = filelist.read_text().strip().splitlines()
83-
if samples > 0 and samples < len(all_ids):
83+
if 0 < samples < len(all_ids):
8484
import random
8585

8686
random.seed(seed)
8787
subset = sorted(random.sample(all_ids, samples))
88-
sub_filelist = Path(DATA_ROOT) / "mp_filelist_benchmark.txt"
89-
sub_filelist.write_text("\n".join(subset) + "\n")
90-
data_root = DATA_ROOT
88+
# Create a temp data root with symlinks to volume data/label dirs
89+
# and the subsampled filelist
90+
data_root = "/tmp/benchmark_data"
91+
Path(data_root).mkdir(parents=True, exist_ok=True)
92+
for subdir in ["data", "label"]:
93+
link = Path(data_root) / subdir
94+
if not link.exists():
95+
link.symlink_to(Path(DATA_ROOT) / subdir)
96+
Path(data_root, "mp_filelist.txt").write_text("\n".join(subset) + "\n")
9197
log.info("Subsampled %d/%d samples", samples, len(all_ids))
9298
else:
9399
data_root = DATA_ROOT
@@ -130,7 +136,7 @@ def main(
130136
channels: int = 32,
131137
residual_blocks: int = 16,
132138
samples: int = 50,
133-
max_file_size: float = 25,
139+
max_file_size: float = 0,
134140
seed: int = 42,
135141
wandb_project: str = "elf-net-ci",
136142
):

0 commit comments

Comments
 (0)