Skip to content

Commit 017a62b

Browse files
committed
docs: document .torchxconfig usage with component:
1 parent 434c013 commit 017a62b

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

torchx/runner/config.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
CLI Usage
1616
~~~~~~~~~~~
1717
18+
19+
**Scheduler Config**
20+
1821
#. ``cd`` into the directory where you want the ``.torchxconfig`` file to be dropped.
1922
The CLI only picks up ``.torchxconfig`` files from the current-working-directory (CWD)
2023
so chose a directory where you typically run ``torchx`` from. Typically this
@@ -66,6 +69,26 @@
6669
6770
$ torchx run -s local_cwd ./my_component.py:train
6871
72+
**Component Config**
73+
74+
You can specify component defaults by adding a section prefixed with
75+
``component:``.
76+
77+
.. code-block:: ini
78+
79+
[component:dist.ddp]
80+
j=2x8
81+
cpu=4
82+
83+
Now when you run the ``dist.ddp`` component those configs are automatically
84+
picked up.
85+
86+
.. code-block:: shell-session
87+
88+
$ torchx run -s local_cwd dist.ddp
89+
... runs with -j 2x8 --cpu 4
90+
91+
6992
Programmatic Usage
7093
~~~~~~~~~~~~~~~~~~~
7194
@@ -265,7 +288,7 @@ def load_sections(
265288
j = 1x2
266289
image = ghcr.io/foo:1
267290
268-
# calling `load_component_defaults(prefix="component")` returns
291+
# calling `load_sections(prefix="component")` returns
269292
# {
270293
# "dist.ddp": {
271294
# "j":"1x2",

0 commit comments

Comments
 (0)