Commit feba9f09 authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

fix: correct GPU memory calculations in build_app_manifest and build_catalog_payload functions

parent b1caa8aa
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ def build_app_manifest(catalog: SRMCatalogPayload) -> AppManifest:
                gpu_entry["numCPU"] = compute.cpu_millicores / 1000
            if compute.memory_mb is not None:
                gpu_entry["memory"] = compute.memory_mb
            gpu_entry["gpuMemory"] = compute.accelerator.memory_mb / 1024
            gpu_entry["gpuMemory"] = compute.accelerator.memory_mb / 1000
            if topo:
                gpu_entry["topology"] = {
                    k: v
@@ -203,7 +203,7 @@ def build_app_manifest(catalog: SRMCatalogPayload) -> AppManifest:
                        if topo.min_node_cpu_millicores
                        else None,
                        "minNodeMemory": topo.min_node_memory_mb,
                        "minNodeGpuMemory": (topo.min_node_gpu_memory_mb / 1024)
                        "minNodeGpuMemory": (topo.min_node_gpu_memory_mb / 1000)
                        if topo.min_node_gpu_memory_mb
                        else None,
                    }.items()
@@ -483,7 +483,7 @@ def build_catalog_payload(translation: AppRegistrationTranslation) -> SRMCatalog
            if gp.memory is not None:
                memory_mb = gp.memory

            accelerator_memory_mb = int(gp.gpu_memory * 1024) if gp.gpu_memory is not None else 0
            accelerator_memory_mb = int(gp.gpu_memory * 1000) if gp.gpu_memory is not None else 0
            accelerator = SRMAccelerator(
                type="gpu",
                units=gp.num_gpu or 0,
@@ -491,7 +491,7 @@ def build_catalog_payload(translation: AppRegistrationTranslation) -> SRMCatalog
            )

            min_node_gpu_memory_mb = (
                int(gp.topology.min_node_gpu_memory * 1024)
                int(gp.topology.min_node_gpu_memory * 1000)
                if gp.topology and gp.topology.min_node_gpu_memory is not None
                else None
            )