Skip to content

Commit b94a27e

Browse files
voorhsclaude
andcommitted
fix: relax warmup_ratio lower bound and regenerate schema
Reviewer flagged that `gt=0` rejects the legal `warmup_ratio=0.0` config (disable warmup). Relax to `ge=0`; `lt=1` is kept because that's the v5 boundary where warmup_steps flips from ratio to raw step count. Regenerate the published JSON schema so it reflects the constraint — otherwise YAML authoring against the schema would pass schema validation and fail at runtime. Pushed back on the reviewer's claim that `warmup_steps=0.1` runs zero warmup: transformers v5 typed `warmup_steps: float` and `get_warmup_steps` branches on `>= 1`, not `> 0` — `0.1` takes the `math.ceil(N * 0.1)` fraction branch (training_args.py:2089 in v5.12.1). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 14f9576 commit b94a27e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

docs/optimizer_search_space_config.schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,8 @@
13021302
},
13031303
"warmup_ratio": {
13041304
"default": 0.1,
1305+
"exclusiveMaximum": 1,
1306+
"minimum": 0,
13051307
"title": "Warmup Ratio",
13061308
"type": "number"
13071309
},

src/autointent/configs/_transformers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class EmbedderFineTuningConfig(BaseModel):
2929
margin: float = Field(default=0.5)
3030
learning_rate: float = Field(default=2e-5)
3131
# Fed to TrainingArguments.warmup_steps in v5, which interprets float<1 as
32-
# a fraction of total steps and float>=1 as a raw step count. Restrict to
33-
# (0, 1) so warmup_ratio=1.0 doesn't silently become a single step.
34-
warmup_ratio: float = Field(default=0.1, gt=0, lt=1)
32+
# a fraction of total steps and float>=1 as a raw step count. Cap below 1
33+
# so warmup_ratio=1.0 doesn't silently become a single step.
34+
warmup_ratio: float = Field(default=0.1, ge=0, lt=1)
3535
early_stopping_patience: int = Field(default=1)
3636
early_stopping_threshold: float = Field(default=0.0)
3737
val_fraction: float = Field(default=0.2)

0 commit comments

Comments
 (0)