-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
feat(tpu): Updating TPU samples to feature TPUv5e #13211
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,19 @@ def create_queued_resource( | |
project_id: str, | ||
zone: str, | ||
tpu_name: str, | ||
tpu_type: str = "v2-8", | ||
runtime_version: str = "tpu-vm-tf-2.17.0-pjrt", | ||
tpu_type: str = "v5litepod-4", | ||
runtime_version: str = "v2-tpuv5-litepod", | ||
queued_resource_name: str = "resource-name", | ||
) -> Node: | ||
# [START tpu_queued_resources_create] | ||
from google.cloud import tpu_v2alpha1 | ||
|
||
# TODO(developer): Update and un-comment below lines | ||
# project_id = "your-project-id" | ||
# zone = "us-central1-b" | ||
# zone = "us-central1-a" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# tpu_name = "tpu-name" | ||
# tpu_type = "v2-8" | ||
# runtime_version = "tpu-vm-tf-2.17.0-pjrt" | ||
# tpu_type = "v5litepod-4" | ||
# runtime_version = "v2-tpuv5-litepod" | ||
# queued_resource_name = "resource-name" | ||
|
||
node = tpu_v2alpha1.Node() | ||
|
@@ -71,7 +71,7 @@ def create_queued_resource( | |
|
||
if __name__ == "__main__": | ||
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") | ||
ZONE = "us-central1-b" | ||
ZONE = "us-central1-a" | ||
create_queued_resource( | ||
project_id=PROJECT_ID, | ||
zone=ZONE, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,8 @@ def create_queued_resource_network( | |
project_id: str, | ||
zone: str, | ||
tpu_name: str, | ||
tpu_type: str = "v2-8", | ||
runtime_version: str = "tpu-vm-tf-2.17.0-pjrt", | ||
tpu_type: str = "v5litepod-4", | ||
runtime_version: str = "v2-tpuv5-litepod", | ||
queued_resource_name: str = "resource-name", | ||
network: str = "default", | ||
) -> Node: | ||
|
@@ -30,10 +30,10 @@ def create_queued_resource_network( | |
|
||
# TODO(developer): Update and un-comment below lines | ||
# project_id = "your-project-id" | ||
# zone = "us-central1-b" | ||
# zone = "us-central1-a" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# tpu_name = "tpu-name" | ||
# tpu_type = "v2-8" | ||
# runtime_version = "tpu-vm-tf-2.17.0-pjrt" | ||
# tpu_type = "v5litepod-4" | ||
# runtime_version = "v2-tpuv5-litepod" | ||
# queued_resource_name = "resource-name" | ||
# network = "default" | ||
|
||
|
@@ -81,7 +81,7 @@ def create_queued_resource_network( | |
|
||
if __name__ == "__main__": | ||
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") | ||
ZONE = "us-central1-b" | ||
ZONE = "us-central1-a" | ||
create_queued_resource_network( | ||
project_id=PROJECT_ID, | ||
zone=ZONE, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,19 @@ def create_queued_resource_spot( | |
project_id: str, | ||
zone: str, | ||
tpu_name: str, | ||
tpu_type: str = "v2-8", | ||
runtime_version: str = "tpu-vm-tf-2.17.0-pjrt", | ||
tpu_type: str = "v5litepod-4", | ||
runtime_version: str = "v2-tpuv5-litepod", | ||
queued_resource_name: str = "resource-name", | ||
) -> Node: | ||
# [START tpu_queued_resources_create_spot] | ||
from google.cloud import tpu_v2alpha1 | ||
|
||
# TODO(developer): Update and un-comment below lines | ||
# project_id = "your-project-id" | ||
# zone = "us-central1-b" | ||
# zone = "us-central1-a" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# tpu_name = "tpu-name" | ||
# tpu_type = "v2-8" | ||
# runtime_version = "tpu-vm-tf-2.17.0-pjrt" | ||
# tpu_type = "v5litepod-4" | ||
# runtime_version = "v2-tpuv5-litepod" | ||
# queued_resource_name = "resource-name" | ||
|
||
node = tpu_v2alpha1.Node() | ||
|
@@ -73,7 +73,7 @@ def create_queued_resource_spot( | |
|
||
if __name__ == "__main__": | ||
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") | ||
ZONE = "us-central1-b" | ||
ZONE = "us-central1-a" | ||
create_queued_resource_spot( | ||
project_id=PROJECT_ID, | ||
zone=ZONE, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,19 @@ def create_queued_resource_startup_script( | |
project_id: str, | ||
zone: str, | ||
tpu_name: str, | ||
tpu_type: str = "v2-8", | ||
runtime_version: str = "tpu-vm-tf-2.17.0-pjrt", | ||
tpu_type: str = "v5litepod-4", | ||
runtime_version: str = "v2-tpuv5-litepod", | ||
queued_resource_name: str = "resource-name", | ||
) -> Node: | ||
# [START tpu_queued_resources_startup_script] | ||
from google.cloud import tpu_v2alpha1 | ||
|
||
# TODO(developer): Update and un-comment below lines | ||
# project_id = "your-project-id" | ||
# zone = "us-central1-b" | ||
# zone = "us-central1-a" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# tpu_name = "tpu-name" | ||
# tpu_type = "v2-8" | ||
# runtime_version = "tpu-vm-tf-2.17.0-pjrt" | ||
# tpu_type = "v5litepod-4" | ||
# runtime_version = "v2-tpuv5-litepod" | ||
# queued_resource_name = "resource-name" | ||
|
||
node = tpu_v2alpha1.Node() | ||
|
@@ -84,7 +84,7 @@ def create_queued_resource_startup_script( | |
|
||
if __name__ == "__main__": | ||
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") | ||
ZONE = "us-central1-b" | ||
ZONE = "us-central1-a" | ||
create_queued_resource_startup_script( | ||
project_id=PROJECT_ID, | ||
zone=ZONE, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,19 @@ def create_queued_resource_time_bound( | |
project_id: str, | ||
zone: str, | ||
tpu_name: str, | ||
tpu_type: str = "v2-8", | ||
runtime_version: str = "tpu-vm-tf-2.17.0-pjrt", | ||
tpu_type: str = "v5litepod-4", | ||
runtime_version: str = "v2-tpuv5-litepod", | ||
queued_resource_name: str = "resource-name", | ||
) -> Node: | ||
# [START tpu_queued_resources_time_bound] | ||
from google.cloud import tpu_v2alpha1 | ||
|
||
# TODO(developer): Update and un-comment below lines | ||
# project_id = "your-project-id" | ||
# zone = "us-central1-b" | ||
# zone = "us-central1-a" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# tpu_name = "tpu-name" | ||
# tpu_type = "v2-8" | ||
# runtime_version = "tpu-vm-tf-2.17.0-pjrt" | ||
# tpu_type = "v5litepod-4" | ||
# runtime_version = "v2-tpuv5-litepod" | ||
# queued_resource_name = "resource-name" | ||
|
||
node = tpu_v2alpha1.Node() | ||
|
@@ -81,7 +81,7 @@ def create_queued_resource_time_bound( | |
|
||
if __name__ == "__main__": | ||
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") | ||
ZONE = "us-central1-b" | ||
ZONE = "us-central1-a" | ||
create_queued_resource_time_bound( | ||
project_id=PROJECT_ID, | ||
zone=ZONE, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ def start_cloud_tpu(project_id: str, zone: str, tpu_name: str = "tpu-name") -> N | |
|
||
# TODO(developer): Update and un-comment below lines | ||
# project_id = "your-project-id" | ||
# zone = "us-central1-b" | ||
# zone = "us-central1-a" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# tpu_name = "tpu-name" | ||
|
||
client = tpu_v2.TpuClient() | ||
|
@@ -57,5 +57,5 @@ def start_cloud_tpu(project_id: str, zone: str, tpu_name: str = "tpu-name") -> N | |
|
||
if __name__ == "__main__": | ||
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") | ||
ZONE = "us-central1-b" | ||
ZONE = "us-central1-a" | ||
start_cloud_tpu(PROJECT_ID, ZONE, "tpu-name") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ def stop_cloud_tpu(project_id: str, zone: str, tpu_name: str = "tpu-name") -> No | |
|
||
# TODO(developer): Update and un-comment below lines | ||
# project_id = "your-project-id" | ||
# zone = "us-central1-b" | ||
# zone = "us-central1-a" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# tpu_name = "tpu-name" | ||
|
||
client = tpu_v2.TpuClient() | ||
|
@@ -58,5 +58,5 @@ def stop_cloud_tpu(project_id: str, zone: str, tpu_name: str = "tpu-name") -> No | |
|
||
if __name__ == "__main__": | ||
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") | ||
ZONE = "us-central1-b" | ||
ZONE = "us-central1-a" | ||
stop_cloud_tpu(PROJECT_ID, ZONE, "tpu-name") |
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.
Consider updating the zone in the comment to match the default value.