Skip to content

Allow empty session name for APIs that take it #1057

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

kiukchung
Copy link
Contributor

Summary:
Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today torchx.runner.Runner() takes an empty string as session_name and returns an app_handle with an empty session name (e.g. local:///app-id) when the run() or schedule() methods are called (see the newly added unittest in torchx/runner/test/api_test.py#test_empty_session_id())

However runner APIs that accept app_handle (e.g. runner.cancel()) will error when the session name is empty. This makes the APIs non-symmetric since the app_handle returned by run/schedule APIs cannot be used.

This PR fixes this.

Differential Revision: D73799333

@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 Apr 28, 2025
@facebook-github-bot
Copy link
Contributor

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

facebook-github-bot pushed a commit that referenced this pull request Apr 28, 2025
Summary:

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Differential Revision: D73799333
@facebook-github-bot
Copy link
Contributor

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

kiukchung added a commit that referenced this pull request Apr 29, 2025
Summary:

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Differential Revision: D73799333
@facebook-github-bot
Copy link
Contributor

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

kiukchung added a commit that referenced this pull request Apr 29, 2025
Summary:
Pull Request resolved: #1057

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Differential Revision: D73799333
kiukchung added a commit that referenced this pull request Apr 29, 2025
Summary:

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
@facebook-github-bot
Copy link
Contributor

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

kiukchung added a commit that referenced this pull request Apr 29, 2025
Summary:
Pull Request resolved: #1057

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
facebook-github-bot pushed a commit that referenced this pull request Apr 30, 2025
Summary:

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
@facebook-github-bot
Copy link
Contributor

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

kiukchung added a commit that referenced this pull request Apr 30, 2025
Summary:

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
@facebook-github-bot
Copy link
Contributor

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

kiukchung added a commit that referenced this pull request Apr 30, 2025
Summary:
Pull Request resolved: #1057

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
facebook-github-bot pushed a commit that referenced this pull request Apr 30, 2025
Summary:

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
@facebook-github-bot
Copy link
Contributor

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

facebook-github-bot pushed a commit that referenced this pull request Apr 30, 2025
Summary:

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
@facebook-github-bot
Copy link
Contributor

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

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

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

kiukchung added a commit that referenced this pull request May 1, 2025
Summary:
Pull Request resolved: #1057

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
@kiukchung kiukchung force-pushed the export-D73799333 branch from 80a9bc3 to 01a2e9a Compare May 1, 2025 03:10
Summary:
Pull Request resolved: #1057

Makes the session name returning and accepting APIs symmetric by allowing empty session names.

Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)

However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty.  This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.

This PR fixes this.

Reviewed By: highker, daniel-ohayon

Differential Revision: D73799333
@facebook-github-bot
Copy link
Contributor

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

@kiukchung kiukchung force-pushed the export-D73799333 branch from 01a2e9a to 6ae5ba0 Compare May 1, 2025 03:18
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