Skip to content

Move the current benchmark configs to yaml files#566

Merged
R-Palazzo merged 21 commits intofeature/benchmark_launcherfrom
issue-532-define-yaml-files
Mar 17, 2026
Merged

Move the current benchmark configs to yaml files#566
R-Palazzo merged 21 commits intofeature/benchmark_launcherfrom
issue-532-define-yaml-files

Conversation

@R-Palazzo
Copy link
Copy Markdown
Collaborator

@R-Palazzo R-Palazzo commented Mar 5, 2026

Resolve #545
CU-86b8h52bh

It's a pretty big PR, thanks in advance for your review :)

Currently the BenchmarkLauncher only works for GCP.
To make it work on other compute servie (e.g. AWS) we will have to define benchmark methods that have similar parameter as the gcp ones (with credentials/compute_config):

def _benchmark_compute_gcp(

@R-Palazzo R-Palazzo self-assigned this Mar 5, 2026
@sdv-team
Copy link
Copy Markdown
Contributor

sdv-team commented Mar 5, 2026

@R-Palazzo R-Palazzo changed the title Issue 532 define yaml files Move the current benchmark configs to yaml files Mar 5, 2026
@R-Palazzo R-Palazzo marked this pull request as ready for review March 5, 2026 18:09
@R-Palazzo R-Palazzo requested a review from a team as a code owner March 5, 2026 18:09
compute_privacy_score: false

compute:
service: 'gcp'
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In this PR, we only indicate which compute service to use. In a future issue, we will move the compute config defined here

Inside this yaml file also

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 93.37748% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.30%. Comparing base (0d8b7f8) to head (7f06606).
⚠️ Report is 1 commits behind head on feature/benchmark_launcher.

Files with missing lines Patch % Lines
sdgym/_benchmark_launcher/_validation.py 90.90% 11 Missing ⚠️
sdgym/_benchmark_launcher/benchmark_launcher.py 78.78% 7 Missing ⚠️
sdgym/_benchmark_launcher/benchmark_config.py 98.21% 1 Missing ⚠️
sdgym/_benchmark_launcher/utils.py 98.63% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           feature/benchmark_launcher     #566      +/-   ##
==============================================================
+ Coverage                       82.41%   83.30%   +0.88%     
==============================================================
  Files                              33       38       +5     
  Lines                            2923     3198     +275     
==============================================================
+ Hits                             2409     2664     +255     
- Misses                            514      534      +20     
Flag Coverage Δ
integration 49.37% <0.33%> (-4.62%) ⬇️
unit 78.42% <93.37%> (+1.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@pvk-developer pvk-developer left a comment

Choose a reason for hiding this comment

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

I think this is looking very good. I would suggest going over the _validation.py and try to modularize it a little bit if you have the time since it is hard to navigate the long functions in there.

@R-Palazzo R-Palazzo force-pushed the issue-532-define-yaml-files branch from abe9001 to f670ba5 Compare March 10, 2026 10:03
@R-Palazzo R-Palazzo requested a review from pvk-developer March 11, 2026 12:41
@@ -0,0 +1,21 @@
method_params:
timeout: 345600
output_destination: 's3://sdgym-benchmark/Debug/Benchmark_Launcher/'
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

TODO: Update before merging

)
"
python -m pip install "sdgym[all]"
python -m pip install "sdgym[all] @ git+https://github.com/sdv-dev/SDGym.git@issue-532-define-yaml-files"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

TODO: Revert before merging

Copy link
Copy Markdown
Contributor

@amontanez24 amontanez24 left a comment

Choose a reason for hiding this comment

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

I think we should restructure the credentials a bit. Lets define a format for the dict like:

gcp:
    GCP_SERVICE_ACCOUNT_JSON: ...
    GCP_SERVICE_ACCOUNT_PATH: ...
    GCP_PROJECT_ID: ...
    GCP_ZONE: ...
sdv_enterprise:
    SDV_ENTERPRISE_USERNAME: ...
    SDV_ENTERPRISE_LICENSE_KEY: ...
aws:
    AWS_ACCESS_KEY_ID: ...
    AWS_SECRET_ACCESS_KEY: ...

We then load this dict and check for expected keys. If they key isn't present we try to load from the environment. So if someone is running with GCP, we would attempt to load all the expected GCP keys from the dict and then check the environment if the dict doesn't have it.

If you want to make the names less redundant, you can remove the prefixes ('SDV', 'AWS', 'GCP') and say that if you are using environment variables you should store it as {service_name}_{key_name}.

def _get_credentials(credential_locations):
"""Get resolved credentials dict."""
config = credential_locations or {}
filepath = config.get('credential_filepath')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in the case where the filepath is provided, is the structure of the credentials dict the same as credential_locations?

Comment on lines +169 to +183
sig = inspect.signature(method_to_run)
required = {
parameter.name
for parameter in sig.parameters.values()
if parameter.default is inspect.Parameter.empty
and parameter.kind
in (inspect.Parameter.POSITIONAL_OR_KEYWORD, inspect.Parameter.KEYWORD_ONLY)
}
required_from_yaml = required - _INJECTED_PARAMS
missing = required_from_yaml - set(method_params)
if missing:
errors.append(
f'method_params: missing required parameters for {method_to_run.__name__}:'
f' {sorted(missing)}'
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this necessary? Can't we just have defaults for whatever they don't provide? The only one that I can see as required is the output destination, and I don't think that one should be grouped with the other parameters.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I removed it in 133a551.

'method_params': dict of parameters to pass to the benchmark method (e.g. timeout),
'credentials': dict specifying how to resolve credentials (e.g. from env vars or a file),
'compute': dict specifying the compute configuration (e.g. service: 'gcp'),
'instance_jobs': list of dicts, each specifying a combination of synthesizers and datasets:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the output destination should be specified with the jobs

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking it makes more sense to have all the results for a benchmark in the same location, but you’re right we could also set one output_destination per instance_job. Both options work for me. Let me know which we prefer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think at some point Kalyan told me we may want to have different output destinations so we should put it with the jobs

@R-Palazzo R-Palazzo requested a review from amontanez24 March 12, 2026 18:24
Copy link
Copy Markdown
Contributor

@amontanez24 amontanez24 left a comment

Choose a reason for hiding this comment

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

I think we're almost there! I left a couple comments and think we should move the output destination to the jobs but besides that looks good

'method_params': dict of parameters to pass to the benchmark method (e.g. timeout),
'credentials': dict specifying how to resolve credentials (e.g. from env vars or a file),
'compute': dict specifying the compute configuration (e.g. service: 'gcp'),
'instance_jobs': list of dicts, each specifying a combination of synthesizers and datasets:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think at some point Kalyan told me we may want to have different output destinations so we should put it with the jobs

@R-Palazzo R-Palazzo requested a review from amontanez24 March 16, 2026 15:19
@R-Palazzo R-Palazzo merged commit 6bdfdae into feature/benchmark_launcher Mar 17, 2026
51 checks passed
@R-Palazzo R-Palazzo deleted the issue-532-define-yaml-files branch March 17, 2026 12:16
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.

4 participants