Skip to content
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

Benchmark options #938

Merged
merged 2 commits into from
Nov 15, 2023
Merged

Benchmark options #938

merged 2 commits into from
Nov 15, 2023

Conversation

Kern--
Copy link
Contributor

@Kern-- Kern-- commented Nov 13, 2023

Issue #, if available:
N/A

Description of changes:

All of our existing benchmark images are run with the same set of containerd
options which are only configurable at the test level to control things
like which snapshotter is used.

This is a problem for benchmarking GPU workloads, for example, where we need to
pass additional options to mount the GPU in the container which don't
apply to all images in the test.

Additionally, our benchmarker assumes that the benchmarked images
require no configuration, however this can make experimentation hard in
cases where a single base-image can be used for multiple use cases
depending on environment variables, confiration mounts, etc.

This change adds the ability to configure image-specific options when
loading benchmarks from json. The options are not required and if not
passed, the benchmarker will behave as it did before this change.

The set of options available in this change are those that were
necessary for benchmarking the LLM workloads that I was trying to test.
They are not comprehensive, but can be built upon as use cases arise.


I kept 2 commits to separate some refactoring that I needed to make these change from the changes themselves. I'm happy to squash or pull out the refactoring into a separate commit if that's preferred.

Testing performed:
~/benchmark.json

[{
  "short_name": "djl-serving",
  "image_ref": "<ACCOUNT>.dkr.ecr.us-west-2.amazonaws.com/djl-serving:0.25.0-deepspeed",
  "soci_index_manifest_ref": "<INDEX DIGEST>",
  "ready_line": "ModelServer BOTH API bind to: http://0.0.0.0:8080/",
  "timeout_sec": 1000,
  "options": {
    "net": "host",
    "gpu": true,
    "shm_size": 1000000,
    "mounts": [
      {
        "source": "/home/ubuntu/model",
        "destination": "/opt/ml/model",
        "type": "bind",
        "options": ["rbind", "ro"]
      },
      {
        "source": "/home/ubuntu/model_logs",
        "destination": "/opt/djl/logs",
        "type": "bind",
        "options": ["rbind", "rw"]
      }
    ]
  }
}]
BENCHMARK_FLAGS="-count 1 -f ~benchmark-tgi.json" make benchmarks-perf-test
BENCHMARK_FLAGS="-count 1 -f ~/benchmark-tgi.json" make benchmarks-perf-test

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This change passes the full ImageDescriptor to the benchmark tests
rather than deconstructing it. This is really a setup so that we can
pass more complex options in the future.

Signed-off-by: Kern Walster <walster@amazon.com>
@Kern-- Kern-- requested a review from a team as a code owner November 13, 2023 19:08
turan18
turan18 previously approved these changes Nov 13, 2023
benchmark/utils.go Outdated Show resolved Hide resolved
benchmark/utils.go Show resolved Hide resolved
Copy link
Contributor

@sondavidb sondavidb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but is there a reason benchmarkTests.go is in camelcase and everything else uses underscores?

benchmark/framework/containerd_utils.go Outdated Show resolved Hide resolved
All of our existing benchmark images are run with the same set of containerd
options which are only configurable at the test level to control things
like which snapshotter is used.

This is a problem for benchmarking GPU workloads, for example, where we need to
pass additional options to mount the GPU in the container which don't
apply to all images in the test.

Additionally, our benchmarker assumes that the benchmarked images
require no configuration, however this can make experimentation hard in
cases where a single base-image can be used for multiple use cases
depending on environment variables, confiration mounts, etc.

This change adds the ability to configure image-specific options when
loading benchmarks from json. The options are not required and if not
passed, the benchmarker will behave as it did before this change.

The set of options available in this change are those that were
necessary for benchmarking the LLM workloads that I was trying to test.
They are not comprehensive, but can be built upon as use cases arise.

Signed-off-by: Kern Walster <walster@amazon.com>
@Kern--
Copy link
Contributor Author

Kern-- commented Nov 15, 2023

Unrelated, but is there a reason benchmarkTests.go is in camelcase and everything else uses underscores?

No, I don't think so. Historical accident.

@Kern-- Kern-- merged commit f675946 into awslabs:main Nov 15, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants