Skip to content

Commit

Permalink
Add a reminder for the illeagle memory error encountered in the GPU v…
Browse files Browse the repository at this point in the history
…ersion of neighbor stat.
  • Loading branch information
Yi-FanLi authored May 25, 2024
1 parent 8cd3cba commit bebac62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deepmd/utils/batch_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def __init__(self, initial_batch_size: int = 1024, factor: float = 2.0) -> None:
self.maximum_working_batch_size = initial_batch_size
if self.is_gpu_available():
self.minimal_not_working_batch_size = 2**31
log.info(
"You may encounter the error \"an illegal memory access was encountered\". "
"It is due to some issue of TensorFlow. "
"If you see this error, you can set the environment variable DP_INFER_BATCH_SIZE to a value smaller than the batch size you see adjusted. "
"The environment variable DP_INFER_BATCH_SIZE controls the inference batch size (nframes * natoms). "
)
else:
self.minimal_not_working_batch_size = (
self.maximum_working_batch_size + 1
Expand Down

0 comments on commit bebac62

Please sign in to comment.