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

Added SU rate for H100 GPU #86

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions src/openstack_billing_db/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Rates(object):
gpu_v100: Decimal
gpu_a2: Decimal
gpu_k80: Decimal
gpu_h100: Decimal

include_stopped_runtime: bool

Expand All @@ -41,6 +42,7 @@ class Rates(object):
gpu_v100_su_name: str = "OpenStack GPUV100"
gpu_a2_su_name: str = "OpenStack GPUA2"
gpu_k80_su_name: str = "OpenStack GPUK80"
gpu_h100_su_name: str = "OpenStack GPUH100" # TODO Confirm this is SU name for H100
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knikolla @naved001 Is this acceptable as the H100 GPU SU name?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I'd call it. @joachimweyl does this name seem right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good to me.



@dataclass()
Expand All @@ -63,6 +65,7 @@ class ProjectInvoice(object):
gpu_v100_su_hours: int = 0
gpu_k80_su_hours: int = 0
gpu_a2_su_hours: int = 0
gpu_h100_su_hours: int = 0

institution_specific_code: str = "N/A"

Expand Down Expand Up @@ -90,6 +93,10 @@ def gpu_k80_su_cost(self) -> Decimal:
def gpu_a2_su_cost(self) -> Decimal:
return self.rates.gpu_a2 * self.gpu_a2_su_hours

@property
def gpu_h100_su_cost(self) -> Decimal:
return self.rates.gpu_h100 * self.gpu_h100_su_hours


def get_runtime_for_instance(
instance: model.Instance,
Expand Down Expand Up @@ -210,6 +217,7 @@ def write(invoices, output, invoice_month=None):
"gpu_v100",
"gpu_k80",
"gpu_a2",
"gpu_h100",
]:
# Each project gets two rows, one for CPU and one for GPU
hours = invoice.__getattribute__(f"{invoice_type}_su_hours")
Expand Down
5 changes: 5 additions & 0 deletions src/openstack_billing_db/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def main():
parser.add_argument(
"--rate-gpu-a2-su", default=0, type=Decimal, help="Rate of GPU A2 SU/hr"
)
parser.add_argument(
"--rate-gpu-h100-su", default=0, type=Decimal, help="Rate of GPU H100 SU/hr"
)
parser.add_argument(
"--include-stopped-runtime",
default=False,
Expand Down Expand Up @@ -212,6 +215,7 @@ def get_decimal_rate(rate_name):
gpu_v100=get_decimal_rate("GPUV100 SU Rate"),
gpu_k80=get_decimal_rate("GPUK80 SU Rate"),
gpu_a2=get_decimal_rate("GPUA2 SU Rate"),
gpu_h100=get_decimal_rate("GPUH100 SU Rate"),
include_stopped_runtime=(
nerc_repo_rates.get_value_at(
"Charge for Stopped Instances", args.invoice_month
Expand All @@ -227,6 +231,7 @@ def get_decimal_rate(rate_name):
gpu_v100=args.rate_gpu_v100_su,
gpu_k80=args.rate_gpu_k80_su,
gpu_a2=args.rate_gpu_a2_su,
gpu_h100=args.rate_gpu_h100_su,
include_stopped_runtime=args.include_stopped_runtime,
)

Expand Down
8 changes: 7 additions & 1 deletion src/openstack_billing_db/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ def _get_gpu_flavor_info(pci_info):
raise Exception

pci_name = pci_info[0].get("alias_name", "").lower()
if pci_name not in ["a100", "a100-sxm4", "v100", "k80"]:
if pci_name not in [
"a100",
"a100-sxm4",
"v100",
"k80",
"h100",
]: # TODO Confirm this is the pci_name for H100s
Copy link
Contributor Author

@QuanMPhm QuanMPhm Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knikolla @naved001 Will this be the pci_name for H100s?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably, but we don't know for sure.

raise Exception(f"Invalid pci_name {pci_name}.")

count = int(pci_info[0]["count"])
Expand Down
3 changes: 2 additions & 1 deletion tools/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ spec:
--rate-gpu-a100-su 1.803 \
--rate-gpu-v100-su 1.214 \
--rate-gpu-k80-su 0.463 \
--rate-gpu-a2-su 0.463
--rate-gpu-a2-su 0.463 \
--rate-gpu-h100-su 6.04 \
imagePullPolicy: Always