Skip to content

Compute AnyFlow latent interpolation in FP32 - #3300

Merged
bghira merged 1 commit into
mainfrom
fix/anyflow-fp32-interpolation
Oct 28, 2026
Merged

bghira merged 1 commit into
mainfrom
fix/anyflow-fp32-interpolation

Conversation

@bghira

@bghira bghira commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

BF16 and FP16 latent interpolation can round nearby finite-difference points onto the same or unevenly spaced latent values, producing an incorrect MeanFlow derivative even for an exact velocity field.

Compute the sigma path in at least FP32 while preserving FP64 inputs and leaving the original latent/noise tensors unchanged. Regression tests cover low-precision inputs across three epsilon values and verify zero loss and gradient for an exact velocity solution. Place the regressions in the top-level test directory so normal unittest discovery runs them.

Validation:

  • .venv/bin/python -m unittest -v -f tests.test_anyflow_interpolation_precision tests.helpers.distillation.test_anyflow_distiller — 65 tests passed.
  • Both new regressions fail against the original interpolation implementation.
  • All pre-commit hooks passed.
  • .venv/bin/python -m unittest discover -v -f tests/ — 7,109 tests completed successfully, with 323 skips.

@bghira
bghira merged commit 0605087 into main Oct 28, 2026
2 checks passed
@bghira
bghira deleted the fix/anyflow-fp32-interpolation branch October 28, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant