-
Notifications
You must be signed in to change notification settings - Fork 135
schedulers: add macro support to metadata variables #921
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
schedulers: add macro support to metadata variables #921
Conversation
This pull request was exported from Phabricator. Differential Revision: D57519702 |
This pull request was exported from Phabricator. Differential Revision: D57519702 |
a4bf5af
to
f414e8c
Compare
Summary: Pull Request resolved: pytorch#921 This adds torchx.spec.macros support to the metadata variable values. This allows use cases like setting smcBridge to the app_id eg: ``` job_spec.roles[0].metadata["mast"] = { "HpcTaskGroupSpec": { "smcBridge": { "portName": "thrift", "smcTier": specs.macros.app_id, } } } ``` Reviewed By: manav-a Differential Revision: D57519702
This pull request was exported from Phabricator. Differential Revision: D57519702 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D57519702 |
Summary: Pull Request resolved: pytorch#921 This adds torchx.spec.macros support to the metadata variable values. This allows use cases like setting smcBridge to the app_id eg: ``` job_spec.roles[0].metadata["mast"] = { "HpcTaskGroupSpec": { "smcBridge": { "portName": "thrift", "smcTier": specs.macros.app_id, } } } ``` Reviewed By: manav-a Differential Revision: D57519702
f414e8c
to
c747213
Compare
This pull request was exported from Phabricator. Differential Revision: D57519702 |
@@ -189,8 +190,25 @@ def apply(self, role: "Role") -> "Role": | |||
role = copy.deepcopy(role) | |||
role.args = [self.substitute(arg) for arg in role.args] | |||
role.env = {key: self.substitute(arg) for key, arg in role.env.items()} | |||
role.metadata = self._apply_nested(role.metadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a test-case for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a test case on the meta side of this make me can also add a version of it to api test @jason-b-akers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kiukchung. There's an internal test in D58678835. As a follow-up I'll write one in torchx/schedulers/test/api_test.py as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up test in PR#923
Summary: Adds unit test covering metadata macros. Post-merge follow-up for PR#921: pytorch#921 requested by kiukchung. Differential Revision: D58713685
Summary: Pull Request resolved: pytorch#923 Adds unit test covering metadata macros. Post-merge follow-up for PR#921: pytorch#921 requested by kiukchung. Reviewed By: manav-a Differential Revision: D58713685
Differential Revision: D58713685 Pull Request resolved: #923
Summary:
This adds torchx.spec.macros support to the metadata variable values. This allows use cases like setting smcBridge to the app_id eg:
Reviewed By: manav-a
Differential Revision: D57519702