Skip to content

Commit 7fa7fdd

Browse files
committed
Update PR template and more error message
1 parent 824c908 commit 7fa7fdd

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

.github/pull_request_template.md

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
1-
## What's changing and why?
1+
### What's changing and why?
22
<!-- Describe what you're changing and the motivation behind it -->
33

44

5-
## Before/After UX
5+
### Before/After UX
66
<!-- Show the user experience before and after your changes -->
77
**Before:**
88

99

1010
**After:**
1111

1212

13-
## How was this change tested?
13+
### How was this change tested?
1414
<!-- Describe your testing approach -->
1515

16+
## Do we need integration tests and why?
1617

17-
## Unit test coverage
18-
<!-- Check unit test coverage for your changes -->
19-
- [ ] All new/modified code has unit tests
20-
- [ ] Coverage verified for changed code
21-
- [ ] N/A - no testable code changes
18+
### For Reviewers
19+
#### No PR should be approved if PR check fails. Author must provide reason in comment when failed PR check
2220

23-
## Do we need integration tests?
24-
<!-- Consider if integration tests are needed -->
25-
- [ ] Yes - integration tests added
26-
- [ ] No - unit tests sufficient
27-
- [ ] No - infrastructure/config change only
28-
- [ ] Unsure - please advise
29-
30-
---
31-
32-
## Checklist
33-
- [ ] PR title clearly describes the change
34-
- [ ] No sensitive information exposed and security is maintained
35-
- [ ] Ready for review
21+
- [ ] All PR checks have passed, or the author has provided reason for bypassing.
22+
- [ ] Unit tests and necessary integration tests have been added.

src/sagemaker/hyperpod/training/quota_allocation_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ def _is_valid(vcpu: Optional[float], memory_in_gib: Optional[float], accelerator
247247
return False, f"Invalid instance-type {instance_type}. Please re-check the instance type and contact AWS for support."
248248

249249
if instance_type is not None:
250-
#both resources and node count specified
250+
# both resources and node count specified
251251
if (has_gpu_quota_allocation and node_specified):
252-
return False, f"Missing input: either node-count or a combination of accelerators, vcpu, memory-in-gib must be specified for instance-type {instance_type}"
252+
return False, f"Invalid input: For instance-type {instance_type}, specify either node-count OR resource allocation (accelerators, vcpu, memory-in-gib), but not both."
253253
return True, ""
254254

255255

test/integration_tests/training/cli/test_gpu_quota_allocation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ def test_invalid_node_count_accelerators_parameter(self, test_job_name):
236236
text=True
237237
)
238238
assert result.returncode != 0
239-
assert "Missing input: either node-count or a combination of accelerators, vcpu, " in result.stdout
240-
assert "memory-in-gib must be specified for instance-type ml.g5.8xlarge" in result.stdout
239+
assert "Invalid input: For instance-type ml.g5.xlarge, specify either node-count OR resource allocation (accelerators, vcpu, memory-in-gib), but not both." in result.stdout
241240

242241
def test_invalid_no_node_count_or_quota_parameter(self, test_job_name):
243242
"""Test that case where both node-count and any of the quota parameters are provided"""

test/unit_tests/cli/test_quota_allocation_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def test_is_valid_invalid_instance_type(self):
204204
def test_is_valid_both_node_count_and_resources(self):
205205
valid, message = _is_valid(4.0, None, None, 2, "ml.g5.xlarge")
206206
assert not valid
207-
assert message == "Missing input: either node-count or a combination of accelerators, vcpu, memory-in-gib must be specified for instance-type ml.g5.xlarge"
207+
assert message == "Invalid input: For instance-type ml.g5.xlarge, specify either node-count OR resource allocation (accelerators, vcpu, memory-in-gib), but not both."
208208

209209
def test_is_valid_both_node_count_and_limits(self):
210210
valid, message = _is_valid(None, None, None, 2, "ml.g5.xlarge")

0 commit comments

Comments
 (0)