Skip to content

Commit 4845a7c

Browse files
committed
fix gpu allocation validation error
1 parent 789b4fd commit 4845a7c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sagemaker/hyperpod/training/quota_allocation_util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# language governing permissions and limitations under the License.
1313
import logging
1414
import re
15+
import traceback
1516
from sagemaker.hyperpod.cli.constants.command_constants import NVIDIA_GPU_RESOURCE_LIMIT_KEY, NEURON_RESOURCE_LIMIT_KEY
1617
from sagemaker.hyperpod.cli.utils import (
1718
setup_logger
@@ -139,11 +140,12 @@
139140
}
140141

141142
def _has_compute_resource_quota_allocation_resources(memory_in_gib: Optional[float], vcpu: Optional[float], accelerators: Optional[int]) -> bool:
142-
return (
143+
result = (
143144
(memory_in_gib is not None) or
144145
(vcpu is not None ) or
145-
(accelerators is not None)
146+
(accelerators is not None and accelerators > 0) # Fix: treat accelerators=0 as not specified
146147
)
148+
return result
147149

148150
# Gets resources from compute quotas that user provided; if not all provided, calculates defaults.
149151
def _get_resources_from_compute_quotas(instance_type: str,

0 commit comments

Comments
 (0)