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

add sleeping and spinning benchmark #846

Merged
merged 4 commits into from
Apr 6, 2024
Merged

add sleeping and spinning benchmark #846

merged 4 commits into from
Apr 6, 2024

Conversation

HermioneKT
Copy link
Contributor

@HermioneKT HermioneKT commented Jan 31, 2024

This PR add 2 new benchmarks sleeping (to simulate I/O bounded task) and spinning (to simulate CPU bounded task) such that i can investigate how dynamically configure cpu frequency affects latency of such tasks

@HermioneKT HermioneKT self-assigned this Jan 31, 2024
Copy link
Contributor

@dhschall dhschall left a comment

Choose a reason for hiding this comment

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

Hi @HermioneKT,
first of all thank you very much for contributing new benchmarks. Overall it looks already quite good but there are a couple of things to address.

First, both functions are almost the same. How about if you combine both, make one function and make it configurable with a input argument.

function = flag.String("functionality", "sleep", "Define the functionality of the function. Possible values: [sleep, spin]")

This way less files need to be maintained. Also, one can easily add a memory-intense version that randomly reads and writes from and to a large memory region (Btw. would be nice if you can add that already ;))
You can keep two yaml files. One with - --functionality=sleep and another one with spin.

Second, I think you should make the spinning as a delay as well. I don't know how much time it takes for the 30000 loop iterations. Is it long or short? Having a parameter that lets you spin for 20 ms is more intuitive.

Then we need to integrate it into the CI. Just copy the .github/workflows/e2e-gptj.yml file and replace all gptj references with your new image. I.e.


No worries I'll help you with that :)

Small changes see my other comments.

Finally, before we merge you need to squash all commits into one commit and you also need to sign-off the commit. Refer to: https://github.com/vhive-serverless/vHive/blob/main/docs/contributing_to_vhive.md#commit-sign-off

Thanks, again and let me know if something is unclear or you need help

@dhschall
Copy link
Contributor

I also added a CI workflow and tested it in #852.
Can you copy the spin-sleep.yaml in your code.
Also as you see here https://github.com/vhive-serverless/vSwarm/actions/runs/7856433672/job/21439224624#step:9:1 it fails to deploy in knative

@HermioneKT HermioneKT force-pushed the new_benchmarks branch 2 times, most recently from 2657986 to 87ddb8e Compare March 30, 2024 07:04
Signed-off-by: HermioneKT <hermionegrangerkt@gmail.com>
@HermioneKT
Copy link
Contributor Author

Hi @dhschall, I have fixed the end-to-end test, thank you! I would like to request review from you again if possible.

@HermioneKT HermioneKT requested a review from dhschall March 30, 2024 07:18
Copy link
Contributor

@dhschall dhschall left a comment

Choose a reason for hiding this comment

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

Thank you @HermioneKT for the update. It looks all very great!
Great you made the CI work. Sometimes that is a bit annoying ;)

Can you now just add the second benchmark into the same file. Otherwise the second benchmark will never be build and tested.

var (
zipkin = flag.String("zipkin", "http://localhost:9411/api/v2/spans", "zipkin url")
address = flag.String("addr", "0.0.0.0:50051", "Address:Port the grpc server is listening to")
delay = flag.Int("sleep-delay", 50, "Delay the function sleeps before sending the response (in milliseconds)")
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for adding the delay parameter. Can you make it the same indentation level as the others
You can also run the go linter.


The spinning benchmark simulates a simple cpu bounded bounded task by allowing multiplication for 30000000 iterations.

This benchmark can be used to verify that increasing in cpu frequency significantly decrease the latency of CPU-bounded workload.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:
This benchmark can be used to investigate the effects of cpu scaling on the latency of CPU-bound workloads.

spec:
template:
spec:
nodeSelector:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a question what is the nodeSelector for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is to control which node the benchmark should be invoked on. This is because one of my experiments requires spinning benchmark to be invoked on a high frequency node, sleeping benchmark on a low frequency node (which is why we need them in two different knative service with different knative yaml file to specify different nodeSelector) It did not pass the CI previously, because we need to run a command to enable this feature in Knative Serving that allows us to specify a NodeSelector in the pod spec of our Knative service first before deploying the service.

matrix:
service:
[
sleeping-go
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
sleeping-go
sleeping-go,
spinning-go

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add the spinning benchmark otherwise it will never be tested

You also need a second parameter for the docker file:
Similar to:

matrix:
        include:
          - service: sleeping-go
            file: benchmarks/sleeping/docker/Dockerfile

push: true
file: benchmarks/sleeping/docker/Dockerfile
platforms: ${{ env.PLATFORMS }}
target: ${{ matrix.target }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
target: ${{ matrix.target }}

The target is not needed since you only have one function per docker file

uses: docker/build-push-action@v5
with:
push: true
file: benchmarks/sleeping/docker/Dockerfile
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
file: benchmarks/sleeping/docker/Dockerfile
file: ${{ matrix.file }}

Since you have different docker files you have to make this as a parameter.
Similar as you did for knative

Signed-off-by: HermioneKT <hermionegrangerkt@gmail.com>
Signed-off-by: HermioneKT <hermionegrangerkt@gmail.com>
Signed-off-by: HermioneKT <hermionegrangerkt@gmail.com>
@HermioneKT HermioneKT requested a review from dhschall April 5, 2024 17:04
Copy link
Contributor

@dhschall dhschall left a comment

Choose a reason for hiding this comment

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

Nice, thank you for your contribution.
It looks good to me.
No worries about the linters. They seem to be broken.

@dhschall dhschall merged commit 82eb01d into main Apr 6, 2024
30 of 43 checks passed
@dhschall dhschall deleted the new_benchmarks branch April 6, 2024 13:23
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.

2 participants