-
MLX SFT ignored
training.gradient_accumulation_steps(#684 by @AmirF194 in #696). The wrapper built mlx-lm'sTrainingArgswithout agrad_accumulation_stepskwarg, so mlx-lm's own dataclass default of 1 always applied regardless of the configured value, silently changing the effective batch size and optimizer-update cadence on every MLX run. The writtenadapter_config.jsonalso hardcodedgrad_accumulation_steps: 1, so the drift could not be detected from the output afterwards either. Both now carry the valuetraining.gradient_accumulation_stepsactually resolves to.itersis also rounded down to a whole number of accumulation groups (kept at a minimum of one group), because mlx-lm only updates the optimizer onit % accum == 0and never flushes a trailing partial group; without this a dataset smaller than the accumulation window trained for zero optimizer updates.Anyone who never touched this field will see a different effective batch size after upgrading.
gradient_accumulation_stepsdefaults to 4, so an MLX run that used to update on every micro-batch now accumulates over 4 before updating: a 4x larger effective batch size and roughly a quarter as many optimizer updates for the sameiters. This is the correct value for the schema default; a differently-converging run after this upgrade is expected, not a regression.