Skip to content

Commit

Permalink
Misc doc fixes (#251)
Browse files Browse the repository at this point in the history
See changes for details. Some extra reasoning behind the changes:
* Prefix all GCS buckets with project_id since GCS buckets are globally
  namespaced.
* gcloud storage buckets add-iam-policy-binding" only accepts bucket
  URLs
  • Loading branch information
rsgowman committed Mar 5, 2024
1 parent 34404bd commit e68ada1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ terraform plan
terraform apply
```

To further interact with the Locust inference benchmark, view the README.md file in `benchmark/tools/locust-load-inference`
To further interact with the Locust inference benchmark, view the README.md file in `benchmark/tools/locust-load-inference`
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
This directory contains the script for uploading a filtered and formatted file of prompts based on the "anon8231489123/ShareGPT_Vicuna_unfiltered" dataset to a given GCS path.

Example usage:
python3 upload_sharegpt.py --gcs_path="gs://$BUCKET_NAME/ShareGPT_V3_unfiltered_cleaned_split_filtered_prompts.txt"
```
python3 upload_sharegpt.py --gcs_path="gs://$BUCKET_NAME/ShareGPT_V3_unfiltered_cleaned_split_filtered_prompts.txt"
```

pre-work:
- upload_sharegpt.py assumes that the bucket already exists. If it does not exist, make sure that you create your bucket $BUCKET_NAME in your project prior to running the script. You can do that with the following command:
- upload_sharegpt.py may require additional python libraries; see below.
- upload_sharegpt.py assumes that the bucket already exists. If you've created your cluster via the terraform scripts in `./infra/stage-2`, then the bucket was created for you. (See `terraform.tfvars` in that directory for the name.) If it does not exist, make sure that you create your bucket $BUCKET_NAME in your project prior to running the script. You can do that with the following command:
```
gcloud storage buckets create gs://$BUCKET_NAME --location=BUCKET_LOCATION
```
Expand All @@ -20,7 +23,7 @@ Assumes in your environment you:
- have access to use google storage APIs via Application Default Credentials (ADC)

You may need to do the following:
- run "pip install google-cloud-storage" to install storage client library dependencies
- run "pip install wget google-cloud-storage" to install storage client library dependencies. (Optionally, you can run this within a venv, i.e. `python3 -m venv ./venv && source ./venv/bin/activate && pip install ...`)
- run "gcloud auth application-default login" to enable ADC

For more information on running the google cloud storage API, see https://cloud.google.com/python/docs/reference/storage
For more information on running the google cloud storage API, see https://cloud.google.com/python/docs/reference/storage
4 changes: 2 additions & 2 deletions benchmarks/benchmark/tools/locust-load-inference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The Locust workload requires storage.admin access to view the dataset in the giv
To give viewer permissions on the gcs bucket to the gcloud service account, run the following:

```
gcloud storage buckets add-iam-policy-binding gs://$BUCKET/$DATASET_FILENAME
gcloud storage buckets add-iam-policy-binding gs://$BUCKET
--member=serviceAccount:$GOOGLE_SERVICE_ACCOUNT@$PROJECT_ID.iam.gserviceaccount.com --role=roles/storage.admin
```

Expand Down Expand Up @@ -237,4 +237,4 @@ To change the benchmark configuration, you will have to rerun terraform destroy
| <a name="input_sax_model"></a> [sax\_model](#input\_sax\_model) | Benchmark server configuration for sax model. Only required if framework is sax. | `string` | `""` | no |
| <a name="input_tokenizer"></a> [tokenizer](#input\_tokenizer) | Benchmark server configuration for tokenizer. | `string` | `"tiiuae/falcon-7b"` | yes |
| <a name="input_use_beam_search"></a> [use\_beam\_search](#input\_use\_beam\_search) | Benchmark server configuration for use beam search. | `bool` | `false` | no |
<!-- END_TF_DOCS -->
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ artifact_registry = "us-central1-docker.pkg.dev/$PROJECT_
inference_server_service = "tgi" # inference server service name
locust_runner_kubernetes_service_account = "sample-runner-ksa"
output_bucket = "benchmark-output"
gcs_path = "gs://ai-on-gke-benchmark/ShareGPT_V3_unfiltered_cleaned_split_filtered_prompts.txt"
gcs_path = "gs://${PROJECT_ID}-ai-gke-benchmark-fuse/ShareGPT_V3_unfiltered_cleaned_split_filtered_prompts.txt"

# Benchmark configuration for Locust Docker accessing inference server
inference_server_framework = "tgi"
Expand All @@ -21,4 +21,4 @@ tokenizer = "tiiuae/falcon-7b"
# Benchmark configuration for triggering single test via Locust Runner
test_duration = 60
test_users = 1
test_rate = 5
test_rate = 5
6 changes: 3 additions & 3 deletions benchmarks/infra/stage-2/sample-terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ credentials_config = {
# terraform output -json | jq '."project_id".value'
project_id = "change-me"

bucket_name = "ai-gke-benchmark-fuse"
bucket_name = "${PROJECT_ID}-ai-gke-benchmark-fuse"
bucket_location = "US"

output_bucket_name = "benchmark-output"
output_bucket_name = "${PROJECT_ID}-benchmark-output"
output_bucket_location = "US"

google_service_account = "benchmark-sa"
kubernetes_service_account = "benchmark-ksa"

benchmark_runner_google_service_account = "sample-runner-sa"
benchmark_runner_kubernetes_service_account = "sample-runner-ksa"
benchmark_runner_kubernetes_service_account = "sample-runner-ksa"

0 comments on commit e68ada1

Please sign in to comment.