From 1a8e1eb46e937601cdf38ccda86f0b39e8104e59 Mon Sep 17 00:00:00 2001 From: kiukchung <43595115+kiukchung@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:27:12 -0800 Subject: [PATCH] Revert "torchx/schedulers" (#812) This reverts commit 19497eb1d2649f66cd12ca1eeed77353085f07e0. --- torchx/schedulers/gcp_batch_scheduler.py | 5 ----- torchx/schedulers/test/gcp_batch_scheduler_test.py | 2 -- 2 files changed, 7 deletions(-) diff --git a/torchx/schedulers/gcp_batch_scheduler.py b/torchx/schedulers/gcp_batch_scheduler.py index e52d1ac8d..50a7d5636 100644 --- a/torchx/schedulers/gcp_batch_scheduler.py +++ b/torchx/schedulers/gcp_batch_scheduler.py @@ -205,14 +205,12 @@ def _app_to_job(self, app: AppDef) -> "batch_v1.Job": if cpu <= 0: cpu = 1 MILLI = 1000 - # pyre-fixme[8]: Attribute has type `Field`; used as `int`. res.cpu_milli = cpu * MILLI memMB = resource.memMB if memMB < 0: raise ValueError( f"memMB should to be set to a positive value, got {memMB}" ) - # pyre-fixme[8]: Attribute has type `Field`; used as `int`. res.memory_mib = memMB # TODO support named resources @@ -360,13 +358,11 @@ def describe(self, app_id: str) -> Optional[DescribeAppResponse]: return None gpu = 0 - # pyre-fixme[16]: `Field` has no attribute `instances`. if len(job.allocation_policy.instances) != 0: gpu_type = job.allocation_policy.instances[0].policy.machine_type gpu = GPU_TYPE_TO_COUNT[gpu_type] roles = {} - # pyre-fixme[16]: `RepeatedField` has no attribute `__iter__`. for tg in job.task_groups: env = tg.task_spec.environment.variables role = env["TORCHX_ROLE_NAME"] @@ -390,7 +386,6 @@ def describe(self, app_id: str) -> Optional[DescribeAppResponse]: # TODO map role/replica status desc = DescribeAppResponse( app_id=app_id, - # pyre-fixme[16]: `Field` has no attribute `state`. state=JOB_STATE[job.status.state.name], roles=list(roles.values()), ) diff --git a/torchx/schedulers/test/gcp_batch_scheduler_test.py b/torchx/schedulers/test/gcp_batch_scheduler_test.py index c088b2439..eef7d782b 100644 --- a/torchx/schedulers/test/gcp_batch_scheduler_test.py +++ b/torchx/schedulers/test/gcp_batch_scheduler_test.py @@ -83,9 +83,7 @@ def test_submit_dryrun(self) -> None: env["TORCHX_ROLE_NAME"] = "trainer" env["FOO"] = "bar" res = batch_v1.ComputeResource() - # pyre-fixme[8]: Attribute has type `Field`; used as `int`. res.cpu_milli = 2000 - # pyre-fixme[8]: Attribute has type `Field`; used as `int`. res.memory_mib = 3000 allocationPolicy = batch_v1.AllocationPolicy( instances=[