Conversation
The scale fit computed its normalisation constant 1/sum(F_obs^2) via .double(), which raises on MPS: the backend has no float64, and PYTORCH_ENABLE_MPS_FALLBACK covers unimplemented ops, not unsupported dtypes. This broke every test reaching get_scales()/refine_scaler() on the Accelerator CI job, and equally breaks a real TORCHREF_DEVICE=mps refinement. The float64 was unnecessary rather than misplaced. The constant rescales every term of the objective identically, so its own precision cancels out of the minimiser, the gradient direction and the likelihood:penalty ratio; it only has to be finite, positive and O(1)-producing. float32 gives it to ~5e-8 relative on real work sets (torch.sum reduces pairwise, so error grows like log(N)*eps, not N*eps). Also stop the batched direct-summation paths allocating their accumulator as complex128 regardless of configuration, which raises on MPS once max_memory_gb splits the reflection loop and made the batched output dtype disagree with the unbatched one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ldd5qF6gWrhgHMiv7FcfW1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Version 0.6.4
nllto unit-weightlslog_scalewith a Chebyshev polynomialc_isoin sin(theta)/lambdak_sol exp(-ln2 (ss/ss_half)^n), merged sigmoid exponential form