Skip to content

Commit

Permalink
Revert "torchx/schedulers" (#812)
Browse files Browse the repository at this point in the history
This reverts commit 19497eb.
  • Loading branch information
kiukchung authored Jan 30, 2024
1 parent 500911d commit 1a8e1eb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
5 changes: 0 additions & 5 deletions torchx/schedulers/gcp_batch_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand All @@ -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()),
)
Expand Down
2 changes: 0 additions & 2 deletions torchx/schedulers/test/gcp_batch_scheduler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down

0 comments on commit 1a8e1eb

Please sign in to comment.