Skip to content

Commit

Permalink
Update the v100 and a100sxm4 SU definition so it's aligned with what …
Browse files Browse the repository at this point in the history
…we advertise
  • Loading branch information
naved001 committed Feb 10, 2025
1 parent 174864a commit 3985b63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions openshift_metrics/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def get_service_unit(self) -> ServiceUnit:
su_config = {
SU_CPU: {"gpu": -1, "cpu": 1, "ram": 4},
SU_A100_GPU: {"gpu": 1, "cpu": 24, "ram": 74},
SU_A100_SXM4_GPU: {"gpu": 1, "cpu": 32, "ram": 245},
SU_V100_GPU: {"gpu": 1, "cpu": 24, "ram": 192},
SU_A100_SXM4_GPU: {"gpu": 1, "cpu": 32, "ram": 240},
SU_V100_GPU: {"gpu": 1, "cpu": 48, "ram": 192},
SU_UNKNOWN_GPU: {"gpu": 1, "cpu": 8, "ram": 64},
SU_UNKNOWN_MIG_GPU: {"gpu": 1, "cpu": 8, "ram": 64},
SU_UNKNOWN: {"gpu": -1, "cpu": 1, "ram": 1},
Expand Down
9 changes: 8 additions & 1 deletion openshift_metrics/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,19 @@ def test_known_gpu(self):
self.assertEqual(determining_resource, "GPU")

def test_known_gpu_A100_SXM4(self):
pod = self.make_pod(32, 245, 1, invoice.GPU_A100_SXM4, invoice.WHOLE_GPU)
pod = self.make_pod(32, 240, 1, invoice.GPU_A100_SXM4, invoice.WHOLE_GPU)
su_type, su_count, determining_resource = pod.get_service_unit()
self.assertEqual(su_type, invoice.SU_A100_SXM4_GPU)
self.assertEqual(su_count, 1)
self.assertEqual(determining_resource, "GPU")

def test_known_gpu_V100(self):
pod = self.make_pod(48, 192, 1, invoice.GPU_V100, invoice.WHOLE_GPU)
su_type, su_count, determining_resource = pod.get_service_unit()
self.assertEqual(su_type, invoice.SU_V100_GPU)
self.assertEqual(su_count, 1)
self.assertEqual(determining_resource, "GPU")

def test_known_gpu_high_cpu(self):
pod = self.make_pod(50, 96, 1, invoice.GPU_A100, invoice.WHOLE_GPU)
su_type, su_count, determining_resource = pod.get_service_unit()
Expand Down

0 comments on commit 3985b63

Please sign in to comment.