Skip to content

Commit 74f59fb

Browse files
authored
Merge branch 'main' into patch-1
2 parents 5043be4 + 41be1d8 commit 74f59fb

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

dev-requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ pytorch-lightning==2.5.0
2626
tensorboard==2.14.0
2727
sagemaker==2.230.0
2828
torch-model-archiver>=0.4.2
29-
torch>=2.6.0
29+
torch>=2.7.0
3030
torchmetrics==1.6.3
3131
torchserve>=0.10.0
3232
torchtext==0.18.0
33-
torchvision==0.21.0
33+
torchvision==0.22.0
3434
ts==0.5.1
3535
ray[default]
3636
wheel

docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jupytext
1010
ipython_genutils
1111
# https://github.com/jupyter/nbconvert/issues/1736
1212
jinja2>=3.1.4
13-
apache-airflow
13+
apache-airflow==2.10.5

torchx/cli/test/cmd_run_test.py

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
from torchx.cli.argparse_util import ArgOnceAction, torchxconfig
2424
from torchx.cli.cmd_run import _parse_component_name_and_args, CmdBuiltins, CmdRun
25+
from torchx.runner.config import ENV_TORCHXCONFIG
2526
from torchx.schedulers.local_scheduler import SignalException
2627

2728
from torchx.specs import AppDryRunInfo
@@ -40,11 +41,19 @@ def cwd(path: str) -> Generator[None, None, None]:
4041
class CmdRunTest(unittest.TestCase):
4142
def setUp(self) -> None:
4243
self.tmpdir = Path(tempfile.mkdtemp())
44+
45+
# create empty .torchxconfig so that user .torchxconfig is not picked up
46+
empty_config = self.tmpdir / ".torchxconfig"
47+
empty_config.touch()
48+
self.mock_env = patch.dict(os.environ, {ENV_TORCHXCONFIG: str(empty_config)})
49+
self.mock_env.start()
50+
4351
self.parser = argparse.ArgumentParser()
4452
self.cmd_run = CmdRun()
4553
self.cmd_run.add_arguments(self.parser)
4654

4755
def tearDown(self) -> None:
56+
self.mock_env.stop()
4857
shutil.rmtree(self.tmpdir, ignore_errors=True)
4958
ArgOnceAction.called_args = set()
5059
torchxconfig.called_args = set()

torchx/specs/__init__.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
scheduler or pipeline adapter.
1414
"""
1515
import difflib
16-
from typing import Callable, Dict, Optional
16+
from typing import Callable, Dict, Mapping, Optional
1717

1818
from torchx.specs.api import (
1919
ALL,
@@ -48,12 +48,17 @@
4848
)
4949
from torchx.specs.builders import make_app_handle, materialize_appdef, parse_mounts
5050

51-
from torchx.specs.named_resources_aws import NAMED_RESOURCES as AWS_NAMED_RESOURCES
52-
from torchx.specs.named_resources_generic import (
53-
NAMED_RESOURCES as GENERIC_NAMED_RESOURCES,
54-
)
5551
from torchx.util.entrypoints import load_group
5652

53+
from torchx.util.modules import import_attr
54+
55+
AWS_NAMED_RESOURCES: Mapping[str, Callable[[], Resource]] = import_attr(
56+
"torchx.specs.named_resources_aws", "NAMED_RESOURCES", default={}
57+
)
58+
GENERIC_NAMED_RESOURCES: Mapping[str, Callable[[], Resource]] = import_attr(
59+
"torchx.specs.named_resources_generic", "NAMED_RESOURCES", default={}
60+
)
61+
5762
GiB: int = 1024
5863

5964

torchx/specs/finder.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from types import ModuleType
1919
from typing import Any, Callable, Dict, Generator, List, Optional, Union
2020

21-
from torchx.specs import AppDef
2221
from torchx.specs.file_linter import get_fn_docstring, TorchxFunctionValidator, validate
2322
from torchx.util import entrypoints
2423
from torchx.util.io import read_conf_file

0 commit comments

Comments
 (0)