Skip to content

Commit 79c84b4

Browse files
Copilotnjzjz
andcommitted
fix(paddle): Revert strict=True to strict=False in zip() calls
- Reverted all zip() strict=True back to strict=False due to Paddle JIT incompatibility - Affected files: deep_eval.py, se_a.py, transform_output.py, dataloader.py, nlist.py - Fixes TypeError: convert_zip() got an unexpected keyword argument 'strict' The strict parameter is not supported in Paddle's JIT-compiled code, causing test failures in test_dpa2.py and potentially other tests. Reverting to strict=False resolves this compatibility issue. Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
1 parent 734734a commit 79c84b4

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

deepmd/pd/infer/deep_eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def eval(
385385
zip(
386386
[x.name for x in request_defs],
387387
out,
388-
strict=True,
388+
strict=False,
389389
)
390390
)
391391

deepmd/pd/model/descriptor/se_a.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def forward(
769769
self.filter_layers.networks,
770770
self.compress_data,
771771
self.compress_info,
772-
strict=True,
772+
strict=False,
773773
)
774774
):
775775
if self.type_one_side:

deepmd/pd/model/model/transform_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def take_deriv(
122122
split_vv1 = paddle.split(vv1, [1] * size, axis=-1)
123123
split_svv1 = paddle.split(svv1, [1] * size, axis=-1)
124124
split_ff, split_avir = [], []
125-
for vvi, svvi in zip(split_vv1, split_svv1, strict=True):
125+
for vvi, svvi in zip(split_vv1, split_svv1, strict=False):
126126
# nf x nloc x 3, nf x nloc x 9
127127
ffi, aviri = task_deriv_one(
128128
vvi,

deepmd/pd/utils/dataloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def construct_dataset(system: str) -> DeepmdDataSetForLoader:
171171
else:
172172
self.batch_sizes = batch_size * np.ones(len(systems), dtype=int)
173173
assert len(self.systems) == len(self.batch_sizes)
174-
for system, batch_size in zip(self.systems, self.batch_sizes, strict=True):
174+
for system, batch_size in zip(self.systems, self.batch_sizes, strict=False):
175175
if dist.is_available() and dist.is_initialized():
176176
system_batch_sampler = DistributedBatchSampler(
177177
system,

deepmd/pd/utils/nlist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def build_multiple_neighbor_list(
404404
rr.masked_fill(nlist_mask, float("inf"))
405405
nlist0 = nlist
406406
ret = {}
407-
for rc, ns in zip(rcuts[::-1], nsels[::-1], strict=True):
407+
for rc, ns in zip(rcuts[::-1], nsels[::-1], strict=False):
408408
nlist0 = nlist0[:, :, :ns].masked_fill(rr[:, :, :ns] > rc, -1)
409409
ret[get_multiple_nlist_key(rc, ns)] = nlist0
410410
return ret

0 commit comments

Comments
 (0)