Skip to content

feat: add config-based named_resources support (#1085) #1086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clumsy
Copy link
Contributor

@clumsy clumsy commented Jun 30, 2025

Fixes #1085

Test plan:
[x] Unit tests added

[x] Tested locally, e.g.:

[named_resources]
my_device={"cpu": 100, "gpu": 0, "memMB": 819200, "devices": {"vpc.amazonaws.com/efa": 1}}

[component:utils.sh]
h=my_device


Running
torchx run -s local_cwd utils.sh cal

Gives:

torchx 2025-06-29 22:29:34 INFO     loaded configs from /private/tmp/dynamic_device/.torchxconfig
torchx 2025-06-29 22:29:35 INFO     Tracker configurations: {}
torchx 2025-06-29 22:29:35 INFO     Log directory not set in scheduler cfg. Creating a temporary log dir that will be deleted on exit. To preserve log directory set the `log_dir` cfg option
torchx 2025-06-29 22:29:35 INFO     Log directory is: /var/folders/8b/nbn0wcb93m710myrqx8r_clh0000gq/T/torchx_ue1_qcab
local_cwd://torchx/sh-mjpvn04c5kmnfc
torchx 2025-06-29 22:29:35 INFO     Waiting for the app to finish...
sh/0      June 2025
sh/0 Su Mo Tu We Th Fr Sa
sh/0  1  2  3  4  5  6  7
sh/0  8  9 10 11 12 13 14
sh/0 15 16 17 18 19 20 21
sh/0 22 23 24 25 26 27 28
sh/0 29 30
sh/0
torchx 2025-06-29 22:29:36 INFO     Job finished: SUCCEEDED

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 30, 2025
@clumsy
Copy link
Contributor Author

clumsy commented Jun 30, 2025

For your consideration @kiukchung , @d4l3k , @tonykao8080 , @andywag
If you're in favor of the feature - please feel free to suggest naming/formatting changes. Thanks!

@clumsy
Copy link
Contributor Author

clumsy commented Jul 10, 2025

Could you please have a look, @kiukchung?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config-based named resources
3 participants