Skip to content

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

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

jason-b-akers
Copy link
Contributor

Summary:
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

@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 14, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57519702

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57519702

jason-b-akers added a commit to jason-b-akers/torchx that referenced this pull request Jun 17, 2024
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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57519702

1 similar comment
@facebook-github-bot
Copy link
Contributor

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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57519702

@manav-a manav-a self-requested a review June 17, 2024 17:21
@@ -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)
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

@jason-b-akers jason-b-akers Jun 18, 2024

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

@facebook-github-bot facebook-github-bot merged commit 5058b6b into pytorch:main Jun 17, 2024
23 of 24 checks passed
jason-b-akers added a commit to jason-b-akers/torchx that referenced this pull request Jun 18, 2024
Summary:
Adds unit test covering metadata macros.

Post-merge follow-up for PR#921: pytorch#921 requested by kiukchung.

Differential Revision: D58713685
jason-b-akers added a commit to jason-b-akers/torchx that referenced this pull request Jun 18, 2024
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
facebook-github-bot pushed a commit that referenced this pull request Jun 18, 2024
Differential Revision: D58713685

Pull Request resolved: #923
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. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants