Add CPU unit tests for models/rf3; tidy a mypy suppression#316
Closed
lyskov-ai wants to merge 7 commits into
Closed
Add CPU unit tests for models/rf3; tidy a mypy suppression#316lyskov-ai wants to merge 7 commits into
lyskov-ai wants to merge 7 commits into
Conversation
…_module Cover the pure numeric helpers in rf3.loss.loss and rf3.util_module: - calc_ddihedralmse_dxyz: the hand-derived closed-form dihedral-loss gradient, pinned against torch.autograd of a mirrored forward, plus zero-at-truth and leading-dim shape preservation. - calc_chiral_grads_flat_impl: empty-centres, scatter routing onto only the centre atoms, index_add_ accumulation for shared atoms, and the no_grad_on_chiral_center flag. - rbf: Gaussian distance-encoding (feature dim, exact values, [0,1]). - init_lecun_normal: module returned, Parameter weight, +/-2*stddev bound, and Lecun std sqrt(scale/fan_in). Test-only; both modules are already mypy-clean. Tests run in float32 (the production coordinate dtype). Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
…duct layer Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
…helpers Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Replace the central pyproject ignore_errors override for rf3.data.paired_msa with a file-level '# mypy: ignore-errors' directive in the module itself. The module is broken against the installed atomworks (subclasses a now-function) and needs a PandasDataset-API refactor to clear honestly; keeping it in mypy's files scope with an in-file directive makes the suppression visible at the point of breakage and re-enables checking the moment the directive is removed. Co-authored-by: lyskov-ai <277346777+lyskov-ai@users.noreply.github.com>
Contributor
Author
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.
Two related pieces of test/type-checking work on
models/rf3, no behavioural changes to the model.CPU unit tests for
models/rf3(the bulk of the diff). Fixture-backed tests pinning the model's pure numeric and behavioural contracts with tiny committed fixtures — no GPU, downloaded checkpoints, or cluster data — so they run in the standard CI environment:layer_utilsshape helpers, the MLFF conformer embedding, triangle attention/multiplication vanilla path, outer-product mean).mypy suppression tidy-up.
rf3/data/paired_msa.pycannot type-check (it subclasses an atomworks class that the current atomworks turned into a factory function, so it also fails to import) and a real fix needs a refactor onto atomworks'PandasDatasetAPI validated on cluster data. Previously it was silenced via a[[tool.mypy.overrides]] ignore_errorsentry inpyproject.toml; that central list is silent and never warns when an entry becomes stale. This moves the suppression to a file-level# mypy: ignore-errorsdirective in the module itself — the module stays in mypy's scope, the reason is documented at the top of the file, and deleting that one line re-enables full checking once the module is fixed.