Skip to content

compatibility follow up with metatensor 0.9.0rc6 + metatomic 0.1.12rc2 + featomic 0.6.6#1128

Closed
sofiia-chorna wants to merge 7 commits into
metatensor:mainfrom
sofiia-chorna:fix-use-targetinfo-quantity
Closed

compatibility follow up with metatensor 0.9.0rc6 + metatomic 0.1.12rc2 + featomic 0.6.6#1128
sofiia-chorna wants to merge 7 commits into
metatensor:mainfrom
sofiia-chorna:fix-use-targetinfo-quantity

Conversation

@sofiia-chorna
Copy link
Copy Markdown
Collaborator

@sofiia-chorna sofiia-chorna commented May 1, 2026

tested versions:

metatensor-{core,torch,operations,learn} 0.2.0rc4/0.9.0rc6/0.5.0rc2/0.5.0rc2
metatomic-{torch,ase} 0.1.12rc2/0.1.1rc1
featomic 0.6.6rc1
featomic-torch 0.7.4rc2

some fixes:
2da11ce - use targets[name].quantity as deprecated on ModelOutput
903841e - is_auxiliary_output also matches singular "feature" (renamed in metatomic)
f0d92ea a66b3f5 and afcb313- recreate or copy tensorblocks
f2d96df - unit="unitless" => ""

not fixed here:
in llpr: compute_cholesky_decomposition error, see #1128 (comment)


📚 Documentation preview 📚: https://metatrain--1128.org.readthedocs.build/en/1128/

@sofiia-chorna sofiia-chorna changed the title Use targetinfo quantity as modeloutput quantity was deprecated Use TargetInfo.quantity as ModelOuput.quantity was deprecated May 1, 2026
@sofiia-chorna sofiia-chorna marked this pull request as ready for review May 1, 2026 12:13
@sofiia-chorna sofiia-chorna requested review from Luthaf and pfebrer May 1, 2026 12:13
for target_name in targets.keys():
# Check if the target is an energy:
if model_outputs[target_name].quantity == "energy":
if targets[target_name].quantity == "energy":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended to match on energy, energy_ensemble, and energy_uncertaintyoutputs, or onlyenergy`?

in the second case, this could be done better using

base_target_name = target_name.split("/")[0]
if base_target_name == "energy"

i.e. checking the output name, handling both energy and energy/pbe0. This way we could also remove the quantity field from metatrain

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but i am wondering that the custom energy names will be missed in this case, like mtt::U0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There really should not be a point to use something like this nowadays =) This kind of naming was used before we got variants on the models outputs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmmm if we remove quantity, old options.yaml will sometimes not work as Sofiia says for example when you pass a target called mtt::U0 (which is what the tutorials do).

Although I agree that the default behavior is a bit strange, everything by default is quantity: "energy" (even spherical targets), it is set here:

CONF_TARGET_FIELDS = OmegaConf.create(
{
"quantity": "energy",
"read_from": "${...systems.read_from}",
"reader": None,
"key": None,
"unit": "",
"per_atom": False,
"type": "scalar",
"num_subtargets": 1,
"description": "",
}
)

which makes quantity: "energy" by itself quite useless, and the code needs to perform further checks to know that it is dealing with an energy, like here:
is_energy = (
(target["quantity"] == "energy")
and (not target["per_atom"])
and target["num_subtargets"] == 1
and target["type"] == "scalar"
)

So yeah I agree this should go away but I'm a bit scared of touching it tbh

@pfebrer
Copy link
Copy Markdown
Contributor

pfebrer commented May 1, 2026

We also need to remove quantity as an argument to ModelOutput? Because if so we have to remove it from here

_ = ModelOutput(quantity=quantity, unit=unit, description=description)
and basically all model.py files

@Luthaf
Copy link
Copy Markdown
Member

Luthaf commented May 1, 2026

Not in this PR, but when updating metatomic yes! You'll get a proper deprecation warning here.

@sofiia-chorna
Copy link
Copy Markdown
Collaborator Author

so, in this PR, we just keep a TargetInfo.quantity fix for now and do the variants migration / remove quantity from ModelOutput later after metatomic release?

@sofiia-chorna sofiia-chorna marked this pull request as draft May 11, 2026 19:19
@sofiia-chorna sofiia-chorna force-pushed the fix-use-targetinfo-quantity branch 2 times, most recently from f807e95 to 102610b Compare May 11, 2026 20:47
@sofiia-chorna
Copy link
Copy Markdown
Collaborator Author

ok, locally i have those errors with the latest release candidates:

tox -e tests

FAILED utils/data/test_readers.py::test_unsupported_target_name - ValueError: invalid model output name 'free_energy': this is not a known quantity. Variant names should look like '<quantity>/<variant>'. Non-standard names should look like '<domain>::<quantity>[/<variant>]'.
FAILED cli/test_train_model.py::test_different_base_precision[64] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_small_validation_set_with_large_batch_size[5-2] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_same_name_targets_extra_data[False] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_empty_test_set - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_restart - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_split_failure - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_train_model.py::test_small_validation_set_with_large_batch_size[10-3] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_atomic_types[atomic_types0] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_with_training_set_indices - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_default_test_set - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_atomic_types[atomic_types1] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_from_options_restart_yaml - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_with_indices_only_validation - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_log_order - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_train_model.py::test_train_explicit_validation_test[True-True-1] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_integer_validation_test_set_size - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_with_indices_file - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_generic_target - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_explicit_validation_test[True-True-2] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_multi_dataset_with_indices - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_direct_forces - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_explicit_validation_test[True-False-1] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_eval_model.py::test_eval[32-bit] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_finetune - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_eval_model.py::test_eval[64-bit] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_eval_model.py::test_eval_batch_size[32-bit] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_eval_model.py::test_eval_batch_size[64-bit] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_eval_model.py::test_eval_export - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_explicit_validation_test[True-False-2] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_eval_model.py::test_eval_multi_dataset - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_eval_model.py::test_eval_no_targets - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_transfer_learn - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_conflicting_info_between_training_sets[False-False] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_transfer_learn_with_forces - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_train_model.py::test_train_explicit_validation_test[False-True-1] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_eval_model.py::test_eval_disk_dataset[.zip] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_transfer_learn_variant - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_eval_model.py::test_eval_disk_dataset[.mts] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_explicit_validation_test[False-True-2] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_explicit_validation_test[False-False-1] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_transfer_learn_inherit_heads - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_explicit_validation_test[False-False-2] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_multiple_datasets - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_train_model.py::test_train_two_datasets_two_forces - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_train_model.py::test_restart_auto[True] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_single_dataset_two_forces - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_train_model.py::test_train_with_zbl - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_restart_auto[False] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_restart_auto_no_outputs - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_empty_validation_set - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_density_of_states - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_restart_different_dataset - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_model_consistency_with_seed[None] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_generic_target_metatensor[False] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_model_consistency_with_seed[1234] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_generic_target_metatensor[True] - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_disk_dataset - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_train_model.py::test_train_disk_dataset_splits_issue_601 - DeprecationWarning: `torch.jit.set_fusion_strategy` is deprecated. Please use `torch.compile` instead.
FAILED cli/test_train_model.py::test_train_memmap_dataset - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block
FAILED cli/test_train_model.py::test_train_mixed_stress - RuntimeError: invalid parameter: can not find gradients with respect to 'positions' in this block

tox -e gap-tests

FAILED test_regression.py::test_regression_train - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_regression.py::test_invariance - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_torchscript.py::test_torchscript - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_torchscript.py::test_torchscript_integers - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock

tox -e pet-tests

FAILED test_basic.py::TestOutput::test_output_features[True] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_features[False] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[True] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[False] - ValueError: unknown unit 'unitless'

tox -e soap-bpnn-tests

FAILED test_basic.py::TestOutput::test_output_multispherical[True] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_multispherical[False] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_spherical_atomic_basis - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_features[True] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_features[False] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[True] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[False] - ValueError: unknown unit 'unitless'

tox -e phace-tests

FAILED test_basic.py::TestOutput::test_output_multispherical[True] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_multispherical[False] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_spherical_atomic_basis - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_features[True] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_features[False] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[True] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[False] - ValueError: unknown unit 'unitless'

tox -e llpr-tests

FAILED test_basic.py::TestCheckpoints::test_checkpoint_did_not_change - KeyError: 'new key in checkpoint: .model_state_dict.covariance_mtt::aux::feature_uncertainty'
FAILED test_llpr.py::test_llpr - subprocess.CalledProcessError: Command '['mtt', 'train', 'options-llpr.yaml', '-o', 'model-llpr.pt']' returned non-zero exit status 1.
FAILED test_llpr.py::test_llpr_ensemble_training[True] - subprocess.CalledProcessError: Command '['mtt', 'train', 'options-llpr-ensemble-training-with-backbone.yaml', '-o', 'model-llpr.pt']' returned non-zero exit status 1.
FAILED test_llpr.py::test_llpr_ensemble_training[False] - subprocess.CalledProcessError: Command '['mtt', 'train', 'options-llpr-ensemble-training.yaml', '-o', 'model-llpr.pt']' returned non-zero exit status 1.
FAILED test_basic.py::TestCheckpoints::test_checkpoint_did_not_change - ValueError: missing reference checkpoint for model version 5 and trainer version 5, we created one for you with the current state of the code. Please move it to checkpoints/model-v5_trainer-v5.ckpt.gz if you have no other changes to do.

tox -e flashmd-tests

ERROR test_basic.py::TestCheckpoints::test_loading_old_checkpoints[restart] - DeprecationWarning: the 'momenta' quantity is deprecated, please update this code to use 'momentum' instead.

tox -e flashmd-symplectic-tests

ERROR test_checkpoints.py::TestCheckpoints::test_loading_old_checkpoints[restart] - DeprecationWarning: the 'momenta' quantity is deprecated, please update this code to use 'momentum' instead.

tox -e mace-tests

FAILED test_basic.py::TestOutput::test_output_multispherical[True-from_hypers] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_multispherical[True-from_file] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_multispherical[False-from_hypers] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_multispherical[False-from_file] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_spherical_atomic_basis[from_hypers] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_spherical_atomic_basis[from_file] - RuntimeError: can not call TensorBlock::release on this block since it is inside a TensorMap or another TensorBlock
FAILED test_basic.py::TestOutput::test_output_last_layer_features[from_hypers-True] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[from_hypers-False] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[from_file-True] - ValueError: unknown unit 'unitless'
FAILED test_basic.py::TestOutput::test_output_last_layer_features[from_file-False] - ValueError: unknown unit 'unitless'

tox -e dpa3-tests

FAILED test_basic.py::TestOutput::test_output_scalar[1-True] - torch.jit.Error: The following operation failed in the TorchScript interpreter.
FAILED test_basic.py::TestTraining::test_continue - torch.jit.Error: The following operation failed in the TorchScript interpreter.

@sofiia-chorna
Copy link
Copy Markdown
Collaborator Author

sofiia-chorna commented May 12, 2026

@Luthaf @pfebrer
would appreciate your opinion on the following test failures:

  1. dpa3
FAILED test_basic.py::TestOutput::test_output_scalar[1-True] - torch.jit.Error: The following operation failed in the TorchScript interpreter.
FAILED test_basic.py::TestTraining::test_continue - torch.jit.Error: The following operation failed in the TorchScript interpreter.

=> actual error:

raise NotEqualError(message) metatensor_torch.operations._utils.NotEqualError: inputs to 'add' should have the same samples, but they are not the same or not in the same order

from:

for name in additive_contributions:
return_dict[name] = mts.add(
return_dict[name],
additive_contributions[name],
)

to fix it, we should probably sort beforehand with mts.sort(...) but i am wondering it will effect the speed? or we'd rather use _add_block_block which is faster? (i am not very keen to use private module though)

@Luthaf
Copy link
Copy Markdown
Member

Luthaf commented May 12, 2026

This one is a bug, fix incoming as soon as tests pass on my machine!

@sofiia-chorna
Copy link
Copy Markdown
Collaborator Author

tested with Luthaf:non-contiguous-equal, dpa3-tests pass, thanks!

@sofiia-chorna
Copy link
Copy Markdown
Collaborator Author

  1. llpr

a) covariance_mtt::aux::feature_uncertainty and the saved checkpoint v4 (covariance_mtt::aux::features_uncertainty, plurar) don't match, so it will require checkpoint update

________________ TestCheckpoints.test_checkpoint_did_not_change ________________
  >               check_same_checkpoint_structure(checkpoint, reference)
  ../../utils/testing/checkpoints.py:224:
  ../../utils/testing/checkpoints.py:57: in check_same_checkpoint_structure
  >               raise KeyError(f"new key in checkpoint: {prefix}.{key}")
  E               KeyError: 'new key in checkpoint:
  .model_state_dict.covariance_mtt::aux::feature_uncertainty'
  ../../utils/testing/checkpoints.py:51: KeyError
  >               raise ValueError(
  E               ValueError: checkpoint structure changed. Please increase the checkpoint
  version and implement checkpoint update
  ../../utils/testing/checkpoints.py:226: ValueError

i am wondering it is not backward compatible? so we should update it together with dependencies bump PR?

b) this one is strange, not sure exactly what changes cause this:

──────────────────────────────── test_llpr ────────────────────────────────
 >       subprocess.check_call(command)
 src/metatrain/llpr/tests/test_llpr.py:38:
 >           raise CalledProcessError(retcode, cmd)
 E           subprocess.CalledProcessError: Command '['mtt', 'train', 'options-llpr.yaml',
 '-o', 'model-llpr.pt']' returned non-zero exit status 1.
 inner subprocess error:
 _LinAlgError: linalg.cholesky: The factorization could not be completed because the input
 is not positive-definite (the leading minor of order 50 is not positive-definite).
 preceded by: "[INFO] - Used regularization parameter of 1.0e-20 to compute the Cholesky
 decomposition"

in error.log:

Traceback (most recent call last):
  File "/Users/sofiia/cosmo/metatrain-fork/.tox/llpr-tests/lib/python3.11/site-packages/metatrain/cli/train.py", line 697, in train_model
    trainer.train(
  File "/Users/sofiia/cosmo/metatrain-fork/.tox/llpr-tests/lib/python3.11/site-packages/metatrain/llpr/trainer.py", line 163, in train
    model.compute_cholesky_decomposition(self.hypers["regularizer"])
  File "/Users/sofiia/cosmo/metatrain-fork/.tox/llpr-tests/lib/python3.11/site-packages/metatrain/llpr/model.py", line 681, in compute_cholesky_decomposition
    cholesky[:] = torch.linalg.cholesky(
                  ^^^^^^^^^^^^^^^^^^^^^^
torch._C._LinAlgError: linalg.cholesky: The factorization could not be completed because the input is not positive-definite (the leading minor of order 48 is not positive-definite).

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/sofiia/cosmo/metatrain-fork/.tox/llpr-tests/lib/python3.11/site-packages/metatrain/__main__.py", line 107, in main
    train_model(**args.__dict__)
  File "/Users/sofiia/cosmo/metatrain-fork/.tox/llpr-tests/lib/python3.11/site-packages/metatrain/cli/train.py", line 708, in train_model
    raise ArchitectureError(e) from e
metatrain.utils.errors.ArchitectureError: _LinAlgError: linalg.cholesky: The factorization could not be completed because the input is not positive-definite (the leading minor of order 48 is not positive-definite).

can investigate deeper of course or hand it over to LLPR people 😁

@sofiia-chorna sofiia-chorna changed the title Use TargetInfo.quantity as ModelOuput.quantity was deprecated compatibility follow up with metatensor 0.9.0rc6 + metatomic 0.1.12rc2 + featomic 0.6.6 May 12, 2026
@Luthaf
Copy link
Copy Markdown
Member

Luthaf commented May 12, 2026

Both LLPR errors are strange. I don't see how any of the changes in metatensor/metatomic could cause these =/

@sofiia-chorna
Copy link
Copy Markdown
Collaborator Author

ok the first issue is related to the check:

is_auxiliary = (
name == "features" or name == "energy_ensemble" or name.startswith("mtt::aux::")
)

where there is only "features" and not "feature" (renamed in metatomic 0.1.12 i guess ?)

i'd just add "feature" to the check in the PR

@sofiia-chorna sofiia-chorna force-pushed the fix-use-targetinfo-quantity branch from 418e692 to afcb313 Compare May 12, 2026 11:44
@sofiia-chorna sofiia-chorna force-pushed the fix-use-targetinfo-quantity branch from afcb313 to ecb59c2 Compare May 12, 2026 12:00
@pfebrer
Copy link
Copy Markdown
Contributor

pfebrer commented May 12, 2026

With the new release candidate, it will be possible to replace all TensorBlock recreations with tensorblock.copy(deep=False): metatensor/metatensor#1128

This can't be done before updating the metatensor dependency, but keep it in mind to later replace as many of these "recreations" as possible, to make the code a bit nicer :)

@sofiia-chorna sofiia-chorna marked this pull request as ready for review May 12, 2026 12:23
@pfebrer
Copy link
Copy Markdown
Contributor

pfebrer commented May 15, 2026

Let's update this PR to use all the new releases instead of release candidates, and we use it as a PR to upgrade the dependencies of metatrain 👍

@sofiia-chorna
Copy link
Copy Markdown
Collaborator Author

featomic and featomic-torch are still release candidates i suppose

@sofiia-chorna sofiia-chorna deleted the fix-use-targetinfo-quantity branch May 15, 2026 15:21
@sofiia-chorna
Copy link
Copy Markdown
Collaborator Author

sorry i will reopen it with the new branch, wanted to simply rename it to correspond to the deps bump 😄

@Luthaf
Copy link
Copy Markdown
Member

Luthaf commented May 15, 2026

featomic and featomic-torch are still release candidates i suppose

Will be released as soon as CI is happy on metatensor/featomic#435

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.

3 participants