Skip to content

Fix invocation overhead experiment #240

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

Merged
merged 2 commits into from
May 10, 2025

Conversation

qdelamea-aneo
Copy link
Contributor

@qdelamea-aneo qdelamea-aneo commented Mar 3, 2025

The experiment to measure the invocation overhead doesn't work due to several bugs in
the code, in particular related to function calls with too many or too few arguments.
The changes proposed here make it possible to run the experiment successfully.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected extraction of server timestamps to ensure accurate data retrieval.
  • Improvements
    • Enhanced CSV data processing by skipping header rows automatically.
    • Adjusted cold start enforcement for more precise benchmarking.

Copy link

coderabbitai bot commented Mar 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes update the InvocationOverhead class by modifying method signatures and internal logic. The run method now passes an additional argument to enforce cold starts, the process method accepts a new parameter and skips CSV headers, and the receive_datagrams method corrects the extraction of server timestamps from results.

Changes

File(s) Change Summary
sebs/experiments/invocation_overhead.py Updated InvocationOverhead class: modified run to add a parameter, changed process signature to accept extend_time_interval and skip CSV headers, and corrected key path for timestamp extraction in receive_datagrams.

Sequence Diagram(s)

Loading
sequenceDiagram
    participant User
    participant InvocationOverhead
    participant DeploymentClient
    participant CSVReader
    participant Result

    User->>InvocationOverhead: run()
    InvocationOverhead->>DeploymentClient: enforce_cold_start(..., benchmark)

    User->>InvocationOverhead: process(..., extend_time_interval)
    InvocationOverhead->>CSVReader: read CSV
    CSVReader-->>InvocationOverhead: skip header, process rows

    InvocationOverhead->>Result: receive_datagrams()
    Result-->>InvocationOverhead: output["result"]["output"]["timestamp"]

Possibly related PRs

  • Fix invocation overhead experiment #240: Both PRs modify the same methods in the InvocationOverhead class, addressing argument handling and data processing, indicating a direct code-level relationship.

Poem

In the garden of code where the benchmarks grow,
The overheads are measured, nice and slow.
With headers now skipped and timestamps set right,
Cold starts enforced in the cool serverless night.
A hop, a skip, a bunny’s delight—
The experiments run, and all is bright! 🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 624cff2 and 21dc2cc.

📒 Files selected for processing (1)
  • sebs/experiments/invocation_overhead.py (4 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sorry, something went wrong.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
sebs/experiments/invocation_overhead.py (1)

165-171: 💡 Verification agent

🧩 Analysis chain

Added extend_time_interval parameter to process method.

The process method signature has been updated to include an extend_time_interval parameter of type int. This parameter appears to be required by the method's implementation, but it's not actually used within the method body.

Do you need to actually use this parameter within the method implementation, or should it be marked as optional with a default value?


🏁 Script executed:

#!/bin/bash
# Check all calls to the 'process' method to see if they provide the extend_time_interval parameter
rg "\.process\(" --type py -A 3 -B 1

Length of output: 466


Inconsistent Handling of extend_time_interval Parameter

The process method in sebs/experiments/invocation_overhead.py now includes an extend_time_interval: int parameter that isn’t actively used in its implementation. However, our search shows conflicting call sites:

  • In sebs.py, the method is invoked with the extend_time_interval argument.
  • In scripts/process_experiments.py, the method is called without providing this parameter.

Consider either integrating the parameter into the method’s logic if it’s needed or making it optional (e.g., extend_time_interval: int = 0) to accommodate the call in scripts/process_experiments.py.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e13320c and 9ace157.

📒 Files selected for processing (2)
  • benchmarks/000.microbenchmarks/030.clock-synchronization/input.py (1 hunks)
  • sebs/experiments/invocation_overhead.py (4 hunks)
🔇 Additional comments (3)
benchmarks/000.microbenchmarks/030.clock-synchronization/input.py (1)

6-6:

❓ Verification inconclusive

Function signature updated, but parameter appears unused.

The function has been updated to include a new benchmarks_bucket parameter, but this parameter isn't used within the function body. This change aligns with the PR objective to fix the invocation overhead experiment by ensuring proper argument handling.


🏁 Script executed:

#!/bin/bash
# Verify how the generate_input function is called in the codebase
rg "generate_input\(" --type py -A 3 -B 1

Length of output: 5990


Unused Parameter in Function Signature: Review benchmarks_bucket Usage

In file
benchmarks/000.microbenchmarks/030.clock-synchronization/input.py, the function

def generate_input(data_dir, size, benchmarks_bucket, input_buckets, output_buckets, upload_func):
    return {'output-bucket': output_buckets[0]}

includes the new benchmarks_bucket parameter per the PR’s intent. However, this parameter isn’t used within the function body. Notably, while some other benchmark modules (e.g., in benchmarks/100.webapps/120.uploader/input.py) use this parameter, others (such as in this clock-synchronization benchmark) do not.

Please verify whether:

  • benchmarks_bucket should be integrated into the function’s logic (for example, to configure bucket operations), or
  • it should be removed (or at least annotated with a comment indicating its future use) to avoid potential confusion.
sebs/experiments/invocation_overhead.py (2)

226-226: Added CSV header row skipping.

Good addition. This line correctly skips the header row of the CSV file, preventing it from being processed as actual data. This fixes a potential bug where the header row might have been incorrectly treated as a data row.


148-148:

✅ Verification successful

Added benchmark parameter to enforce_cold_start call.

The enforce_cold_start method now receives the benchmark parameter, fixing one of the argument mismatches mentioned in the PR objective. This change ensures proper communication with the deployment client when enforcing cold starts.


🏁 Script executed:

#!/bin/bash
# Check the enforce_cold_start method signature to confirm it expects a benchmark parameter
rg "def enforce_cold_start" --type py -A 2

Length of output: 1186


Benchmark parameter addition in enforce_cold_start call is correct
After verifying the method signatures in multiple deployment client implementations (sebs/faas/system.py, sebs/aws/aws.py, sebs/azure/azure.py, etc.), it's confirmed that the enforce_cold_start method indeed expects a second parameter of type Benchmark (named code_package). Passing self._benchmark now properly aligns with the function signature, resolving the previous argument mismatch and ensuring correct communication with the deployment client.

  • File: sebs/experiments/invocation_overhead.py, Line: 148
    • Change: Updated the call to self._deployment_client.enforce_cold_start([self._function], self._benchmark)

@mcopik
Copy link
Collaborator

mcopik commented Mar 3, 2025

@qdelamea-aneo Thank you for fixing the issue, much appreciated! We made multiple changes recently and didn't notice that it broke the experiments.

Were you able to rerun the experiments successfully and fully, i.e., with the initial datagram exchange to establish network latency?

@qdelamea-aneo qdelamea-aneo force-pushed the qd/fix-invocation-overhead branch from 9ace157 to 624cff2 Compare March 18, 2025 21:54
@mcopik mcopik merged commit 693b642 into spcl:master May 10, 2025
@mcopik
Copy link
Collaborator

mcopik commented May 10, 2025

@qdelamea-aneo Thank you so much for your PR and help, much appreciated!

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

2 participants