Summary
DescrptDPA4C.enable_compression() crashes when the descriptor was constructed with the supported trainable=False option.
This reproduces on origin/master at 8cfd46e37448.
Reproduction
from deepmd.pt_expt.descriptor.dpa4c import DescrptDPA4C
d = DescrptDPA4C(
rcut=3.0,
ntypes=2,
channels=8,
lmax=2,
n_radial=4,
precision="float32",
trainable=False,
).eval()
d.enable_compression(0.5, table_stride_1=0.2)
Actual result:
deepmd/kernels/cuda/dpa4c/graph_compress.py:525
sample_parameter = next(descriptor.radial_embedding.parameters())
StopIteration
Cause
build_radial_table() obtains the device and dtype from the first radial-embedding parameter. With trainable=False, the frozen radial MLP weights are registered as buffers, so radial_embedding.parameters() is empty.
Expected behavior
Compression should work for a frozen descriptor. trainable changes parameter registration, not the learned function or compression eligibility.
The device/dtype should be obtained from a tensor that exists in both trainable and frozen forms, and a regression test should enable compression on a trainable=False DPA4C descriptor.
Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh
Summary
DescrptDPA4C.enable_compression()crashes when the descriptor was constructed with the supportedtrainable=Falseoption.This reproduces on
origin/masterat8cfd46e37448.Reproduction
Actual result:
Cause
build_radial_table()obtains the device and dtype from the first radial-embedding parameter. Withtrainable=False, the frozen radial MLP weights are registered as buffers, soradial_embedding.parameters()is empty.Expected behavior
Compression should work for a frozen descriptor.
trainablechanges parameter registration, not the learned function or compression eligibility.The device/dtype should be obtained from a tensor that exists in both trainable and frozen forms, and a regression test should enable compression on a
trainable=FalseDPA4C descriptor.Coding agent: Codex
Codex version: codex-cli 0.149.0
Model: gpt-5.6-sol
Reasoning effort: xhigh