src/vllm/model_executor/models/ltx2_pipeline.cpp:505-506, inside
Ltx2MultiModalGuidance's rescale branch:
// :268-271. torch's `std` is the UNBIASED (N-1) estimator by default; the
// biased one would be a small, everywhere, resolution-dependent gain error.
auto unbiased_std = [count](const float* buffer) { ... sqrt(sum_sq / (count - 1)); };
const float factor_raw = unbiased_std(cond) / unbiased_std(pred.data());
The stated consequence is mathematically impossible. factor_raw divides two
stds taken over the same count, so whichever divisor the estimator uses
cancels exactly:
sqrt(ss_c / (n-1)) / sqrt(ss_p / (n-1)) == sqrt(ss_c / ss_p)
sqrt(ss_c / n ) / sqrt(ss_p / n ) == sqrt(ss_c / ss_p)
There is no gain error, small or otherwise, and nothing about it is
resolution-dependent. The two forms differ only by f32 rounding in the divide.
The header repeats the claim at
include/vllm/model_executor/models/ltx2_pipeline.h:319-322.
Why this is worth a record and not just a typo. The comment tells the next
reader that a gate is needed here, and it is not. The fresh review of #1039
mutated the estimator to the biased form and it survived — correctly, because it
is an identity — and a survivor at that site would otherwise read as a blind
instrument and cost another investigation. The comment is the thing that has to
change; the code is right as written and should stay unbiased_std, because the
name is what mirrors torch even where the ratio does not care.
Pre-existing from cefacd2d0 (#641). Found while repairing the fresh review of
#1039 on PR #1032; out of scope there under that review's explicit exclusions,
and listed under ## Owed in .agents/specs/ltx25-t2a-one-stage.md.
src/vllm/model_executor/models/ltx2_pipeline.cpp:505-506, insideLtx2MultiModalGuidance's rescale branch:The stated consequence is mathematically impossible.
factor_rawdivides twostds taken over the samecount, so whichever divisor the estimator usescancels exactly:
There is no gain error, small or otherwise, and nothing about it is
resolution-dependent. The two forms differ only by f32 rounding in the divide.
The header repeats the claim at
include/vllm/model_executor/models/ltx2_pipeline.h:319-322.Why this is worth a record and not just a typo. The comment tells the next
reader that a gate is needed here, and it is not. The fresh review of #1039
mutated the estimator to the biased form and it survived — correctly, because it
is an identity — and a survivor at that site would otherwise read as a blind
instrument and cost another investigation. The comment is the thing that has to
change; the code is right as written and should stay
unbiased_std, because thename is what mirrors torch even where the ratio does not care.
Pre-existing from
cefacd2d0(#641). Found while repairing the fresh review of#1039 on PR #1032; out of scope there under that review's explicit exclusions,
and listed under
## Owedin.agents/specs/ltx25-t2a-one-stage.md.