Skip to content
Open
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
1 change: 0 additions & 1 deletion docs/source/ext/fbcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import os

from docutils import nodes

from docutils.parsers.rst import directives
from sphinx.util.docutils import SphinxDirective
from sphinx.util.nodes import nested_parse_with_titles
Expand Down
8 changes: 4 additions & 4 deletions fmt-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by `pyfmt --requirements`
black==24.4.2
ruff-api==0.1.0
black==25.11.0
ruff-api==0.2.0
stdlibs==2024.1.28
ufmt==2.8.0
usort==1.0.8.post1
ufmt==2.9.0
usort==1.1.0
1 change: 0 additions & 1 deletion scripts/minikube_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"""

from component_integration_tests import build_and_push_image

from integ_test_utils import getenv_asserts, MissingEnvError
from torchx.components.dist import ddp as dist_ddp
from torchx.runner import get_runner
Expand Down
1 change: 0 additions & 1 deletion torchx/cli/cmd_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import logging

from tabulate import tabulate

from torchx.cli.cmd_base import SubCommand
from torchx.runner import get_runner
from torchx.schedulers import get_default_scheduler_name, get_scheduler_factories
Expand Down
1 change: 0 additions & 1 deletion torchx/cli/cmd_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
_find_role_replicas as find_role_replicas,
_prefix_line,
)

from torchx.util.types import none_throws

logger: logging.Logger = logging.getLogger(__name__)
Expand Down
1 change: 0 additions & 1 deletion torchx/cli/cmd_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import logging

from tabulate import tabulate

from torchx.cli.cmd_base import SubCommand
from torchx.runner.api import get_configured_trackers
from torchx.tracker.api import build_trackers, TrackerBase
Expand Down
1 change: 0 additions & 1 deletion torchx/cli/test/cmd_run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
)
from torchx.runner.config import ENV_TORCHXCONFIG
from torchx.schedulers.local_scheduler import SignalException

from torchx.specs import AppDryRunInfo, CfgVal


Expand Down
1 change: 0 additions & 1 deletion torchx/cli/test/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from unittest.mock import MagicMock, patch

from torchx.cli.argparse_util import ArgOnceAction, torchxconfig

from torchx.cli.cmd_base import SubCommand
from torchx.cli.main import get_sub_cmds, main

Expand Down
2 changes: 0 additions & 2 deletions torchx/components/component_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
from typing import Any, Callable, Dict, Optional

from torchx.runner import get_runner

from torchx.specs import AppDef, AppStatus

from torchx.specs.builders import _create_args_parser
from torchx.specs.finder import get_component

Expand Down
1 change: 0 additions & 1 deletion torchx/components/integration_tests/integ_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from torchx.components.integration_tests.component_provider import ComponentProvider
from torchx.runner import get_runner
from torchx.specs import AppHandle, AppState, AppStatus, CfgVal

from torchx.util.types import none_throws


Expand Down
1 change: 0 additions & 1 deletion torchx/distributed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import torch
import torch.distributed as dist
from torch.distributed.distributed_c10d import _get_default_group

from torchx.util.cuda import has_cuda_devices
from typing_extensions import Literal

Expand Down
1 change: 0 additions & 1 deletion torchx/distributed/test/dist_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import torch
import torch.distributed as dist

from torchx.distributed import (
init_pg,
is_local_rank0,
Expand Down
1 change: 0 additions & 1 deletion torchx/examples/apps/lightning/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from typing import Dict

from pytorch_lightning.loggers.logger import Logger

from pytorch_lightning.profilers.profiler import Profiler


Expand Down
2 changes: 0 additions & 2 deletions torchx/examples/apps/tracker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
import torchx.tracker as tracker
from torch import Tensor
from torch.optim.lr_scheduler import StepLR

from torch.utils.tensorboard import SummaryWriter
from torchvision import datasets, transforms

from torchvision.datasets import VisionDataset


Expand Down
1 change: 0 additions & 1 deletion torchx/runner/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
tracker_config_env_var_name,
)
from torchx.util.session import get_session_id_or_create_new, TORCHX_INTERNAL_SESSION_ID

from torchx.util.types import none_throws
from torchx.workspace import WorkspaceMixin

Expand Down
3 changes: 1 addition & 2 deletions torchx/schedulers/aws_batch_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
Scheduler,
Stream,
)

from torchx.schedulers.devices import get_device_mounts
from torchx.schedulers.ids import make_unique
from torchx.specs.api import (
Expand Down Expand Up @@ -188,7 +187,7 @@ def resource_requirements_from_resource(resource: Resource) -> List[Dict[str, st


def resource_from_resource_requirements(
resource_requirements: List[Dict[str, str]]
resource_requirements: List[Dict[str, str]],
) -> Resource:
resrc_req = {
ResourceType.from_str(r["type"]): int(r["value"]) for r in resource_requirements
Expand Down
1 change: 0 additions & 1 deletion torchx/schedulers/aws_sagemaker_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import boto3
import yaml

from sagemaker.pytorch import PyTorch
from torchx.components.structured_arg import StructuredNameArgument
from torchx.schedulers.api import (
Expand Down
2 changes: 0 additions & 2 deletions torchx/schedulers/kubernetes_mcad_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import json
import logging
import re

import warnings
from dataclasses import dataclass
from datetime import datetime
Expand Down Expand Up @@ -77,7 +76,6 @@
runopts,
VolumeMount,
)

from torchx.workspace.docker_workspace import DockerWorkspaceMixin

if TYPE_CHECKING:
Expand Down
1 change: 0 additions & 1 deletion torchx/schedulers/local_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
from torchx.schedulers.streams import Tee
from torchx.specs import AppDryRunInfo
from torchx.specs.api import AppDef, AppState, is_terminal, macros, NONE, Role, runopts

from torchx.util.types import none_throws

log: logging.Logger = logging.getLogger(__name__)
Expand Down
2 changes: 0 additions & 2 deletions torchx/schedulers/test/lsf_scheduler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# pyre-strict

import unittest

from unittest.mock import MagicMock, patch

import torchx
Expand Down Expand Up @@ -37,7 +36,6 @@
Role,
VolumeMount,
)

from torchx.util import shlex


Expand Down
3 changes: 0 additions & 3 deletions torchx/specs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
scheduler or pipeline adapter.
"""
import difflib

import os
from typing import Callable, Dict, Iterator, Mapping, Optional

Expand Down Expand Up @@ -50,9 +49,7 @@
Workspace,
)
from torchx.specs.builders import make_app_handle, materialize_appdef, parse_mounts

from torchx.util.entrypoints import load_group

from torchx.util.modules import import_attr

GiB: int = 1024
Expand Down
1 change: 0 additions & 1 deletion torchx/specs/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from typing import Callable, Dict, Generator, List, Optional, Union

from torchx.specs import AppDef

from torchx.specs.file_linter import (
ComponentFunctionValidator,
get_fn_docstring,
Expand Down
1 change: 0 additions & 1 deletion torchx/specs/test/builders_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
parse_mounts,
VolumeMount,
)

from torchx.util.types import none_throws


Expand Down
1 change: 0 additions & 1 deletion torchx/specs/test/file_linter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from unittest.mock import patch

from torchx.specs import AppDef

from torchx.specs.file_linter import (
get_fn_docstring,
TorchXArgumentHelpFormatter,
Expand Down
1 change: 0 additions & 1 deletion torchx/specs/test/finder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from unittest.mock import MagicMock, patch

import torchx.specs.finder as finder

from importlib_metadata import EntryPoints
from torchx.runner import get_runner
from torchx.runtime.tracking import FsspecResultTracker
Expand Down
1 change: 0 additions & 1 deletion torchx/test/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

from torch.distributed.elastic.multiprocessing import Std
from torch.distributed.launcher import elastic_launch, LaunchConfig

from torchx.schedulers.test import test_util

IS_CI: bool = os.getenv("CI", "false").lower() == "true"
Expand Down
2 changes: 1 addition & 1 deletion torchx/tracker/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _extract_tracker_name_and_config_from_environ() -> Mapping[str, Optional[str


def build_trackers(
factory_and_config: Mapping[str, Optional[str]]
factory_and_config: Mapping[str, Optional[str]],
) -> Iterable[TrackerBase]:
trackers = []

Expand Down
1 change: 0 additions & 1 deletion torchx/tracker/backend/fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from typing import Any, Dict, Iterable, Mapping, Optional

import fsspec

from torchx.tracker.api import Lineage, TrackerArtifact, TrackerBase, TrackerSource


Expand Down
1 change: 0 additions & 1 deletion torchx/tracker/backend/test/fsspec_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from typing import List

import fsspec

from torchx.tracker.backend.fsspec import (
_decode_torchx_run_id,
_encode_torchx_run_id,
Expand Down
1 change: 0 additions & 1 deletion torchx/tracker/mlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import mlflow
from mlflow import MlflowClient
from mlflow.entities import Experiment, Run

from torchx.distributed import on_rank0_first
from torchx.runner.config import get_configs
from torchx.tracker.api import (
Expand Down
1 change: 0 additions & 1 deletion torchx/tracker/test/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
trackers_from_environ,
TrackerSource,
)

from torchx.tracker.mlflow import MLflowTracker

RunId = str
Expand Down
1 change: 0 additions & 1 deletion torchx/tracker/test/mlflow_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import mlflow
from mlflow.utils.name_utils import _generate_random_name

from torchx.distributed import init_pg, on_rank0_first, rank
from torchx.test.fixtures import DistributedTestCase, IS_CI, IS_MACOS, TestWithTmpDir
from torchx.tracker.mlflow import create_tracker, MLflowTracker
Expand Down
2 changes: 0 additions & 2 deletions torchx/util/test/entrypoints_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

import unittest
from configparser import ConfigParser

from importlib.metadata import EntryPoint
from types import ModuleType

from unittest.mock import MagicMock, patch

from torchx.util.entrypoints import load, load_group
Expand Down
1 change: 0 additions & 1 deletion torchx/workspace/docker_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from typing import Dict, IO, Iterable, Mapping, Optional, TextIO, Tuple, TYPE_CHECKING

import fsspec

import torchx
from docker.errors import BuildError
from torchx.specs import AppDef, CfgVal, Role, runopts
Expand Down
2 changes: 0 additions & 2 deletions torchx/workspace/test/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
# pyre-strict

import shutil

from pathlib import Path
from typing import Mapping

from torchx.specs import CfgVal, Role, Workspace
from torchx.test.fixtures import TestWithTmpDir

from torchx.workspace.api import WorkspaceMixin
from typing_extensions import override

Expand Down
1 change: 0 additions & 1 deletion torchx/workspace/test/docker_workspace_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import fsspec
from docker.errors import BuildError

from torchx.specs import AppDef, Role
from torchx.workspace.docker_workspace import (
_build_context,
Expand Down
Loading