Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix GPU mapping error for Horovod + finetune #3048

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion deepmd/utils/batch_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
)

import numpy as np
from packaging.version import (
Version,
)

from deepmd.env import (
TF_VERSION,
tf,
)
from deepmd.utils.errors import (
Expand Down Expand Up @@ -59,7 +63,10 @@
self.minimal_not_working_batch_size = self.maximum_working_batch_size + 1
else:
self.maximum_working_batch_size = initial_batch_size
if tf.test.is_gpu_available():
if (

Check warning on line 66 in deepmd/utils/batch_size.py

View check run for this annotation

Codecov / codecov/patch

deepmd/utils/batch_size.py#L66

Added line #L66 was not covered by tests
Version(TF_VERSION) >= Version("1.14")
and tf.config.experimental.get_visible_devices("GPU")
) or tf.test.is_gpu_available():
self.minimal_not_working_batch_size = 2**31
else:
self.minimal_not_working_batch_size = (
Expand Down
Loading