> For the complete documentation index, see [llms.txt](https://docs.sdv.dev/sdgym/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sdv.dev/sdgym/benchmarking/run/local.md).

# Local Runs

This page guides you through running the SDGym benchmark locally for single-table datsets. To run on the cloud, please see the guide for [AWS Runs](/sdgym/benchmarking/run/aws.md).

```python
import sdgym

results_summary = sdgym.benchmark_single_table(
    output_destination='my_sdgym_results/',
)
```

See [Interpreting Results](/sdgym/benchmarking/interpreting-results.md) for a description of the benchmarking results.

## Optional Parameters

Every step of the benchmarking process is customizable. Use the optional parameters to control the setup, execution and evaluation.

### Setup

Use these parameters to control which synthesizers and datasets to include in the benchmark.

**`synthesizers`**: Control which synthesizers to use by supplying a list of strings with the synthesizer names

* (default) `['GaussianCopulaSynthesizer', 'CTGANSynthesizer', 'UniformSynthesizer']`
* Options include `'GaussianCopulaSynthesizer'`, '`CTGANSynthesizer'`, `'TVAESynthesizer'` and `'CopulaGANSynthesizer'` , and many more. *You may supply* [*SDV Synthesizers*](/sdgym/customization/synthesizers/sdv-synthesizers.md)*,* [*Basic Synthesizers*](/sdgym/customization/synthesizers/basic-synthesizers.md)*, or* [*3rd Party Synthesizers*](/sdgym/customization/synthesizers/3rd-party-synthesizers.md)*.*

```python
sdgym.benchmark_single_table(
    synthesizers=['TVAESynthesizer', 'ColumnSynthesizer', 'RealTabFormerSynthesizer'])
```

{% hint style="success" %}
**Simulating graceful degradation.** SDGym always runs the UniformSynthesizer as a backup synthesizer, even if it is explicitly specified. This backup synthesizer is used to simulate graceful degradation in an enterprise setting. For more information, see [Graceful Handling of Errors](/sdgym/benchmarking/interpreting-results/results-summary.md#graceful-handling-of-errors).
{% endhint %}

**`custom_synthesizers`**: Supply your own custom synthesizers and variants using a list of classes.

* (default) `None`: Do not run the benchmark on any custom synthesizers
* To create your own class, see [CustomSynthesizers](/sdgym/customization/synthesizers/custom-synthesizers.md). You can also [create a variant](/sdgym/customization/synthesizers/sdv-synthesizers.md#create-an-sdv-variant) of an SDV Synthesizer.

**`sdv_datasets`**: Control which of the SDV demo datasets to use by supplying their names as a list of strings.&#x20;

* (default) `['adult', 'alarm', 'census', 'child', 'expedia_hotel_logs', 'insurance', 'intrusion', 'news', 'covtype']`
* See [Datasets](/sdgym/customization/datasets.md) for more options

**`additional_datasets_folder`**: You can also supply the name of a local folder containing your own datasets.

* (default) `None`: Do not run the benchmark for any additional datasets.
* `<string>`: The path to your folder that contains additional datasets. Make sure your datasets are in the correct format. Make sure your datasets are in the correct format as described in the [Dataset Format](/sdgym/customization/datasets/dataset-format.md) guide.

### Execution

Use these parameters to control speed and flow of the benchmarking.

**`limit_dataset_size`**: Set this boolean to limit the size of every dataset. This will yield faster results but may affect the overall quality.

* (default) `False`: Use the full datasets for benchmarking.
* `True`: Limit the dataset size before benchmarking. For every dataset selected, use only 1000 rows (randomly sampled) and the first 10 columns.

**`timeout`**: The maximum number of seconds to give to each synthesizer to train and sample a dataset

* (default) `None`: Do not set a maximum. Allow the synthesizer to take as long as it needs.
* `<integer>`: Allow a synthesizer to run on the integer number of seconds for each dataset. If the synthesizer is exceeding the time, the benchmark will report a `TimeoutError`.

**`show_progress`**: Show the incremental progress of running the script

* (default) `False`: Do not show the progress. Nothing will be printed on the screen.
* `True`: Print a progress bar to indicate the completion of the benchmarking.

**`output_destination`**: The path to your local folder where you'd like to store the final results and detailed artifacts.

* (default) `None`: Do not save any of the results.
* `<string>`: Store the final results and any detailed artifacts created during the process. For more details on what will be saved, see the [Results Summary](/sdgym/benchmarking/interpreting-results/results-summary.md) and [Artifacts](/sdgym/benchmarking/interpreting-results/explore-the-artifacts.md) guides.

{% hint style="info" %}
**Are you running a benchmark regularly?** We recommend writing to the same `output_destination` folder every time. Each benchmark run will be stored in a different folder, ready for you to explore and compare results. For more information, see the [Artifacts](/sdgym/benchmarking/interpreting-results/explore-the-artifacts.md) guide.
{% endhint %}

<details>

<summary>See deprecated parameters</summary>

These parameters have been deprecated starting from SDGym version 0.11.0. If you'd like to use the features, please see the new recommended usage.

* `run_on_ec2`: Control whether to run the benchmark on your local machine or your Amazon EC2 instance. *Deprecated since SDGym version 0.11.0. To run on EC2, please see our guide for* [*Running a Benchmark on AWS*](/sdgym/benchmarking/run/aws.md)*.*
* `output_filepath`: Supply the name of a file if you'd like to save your results. *Deprecated since SDGym version 0.11.0. Please use the `output_destination` parameter instead.*
* `detailed_results_folder`: Supply the name of the folder if you'd like to save detailed results during the benchmarking computation. *Deprecated since SDGym version 0.11.0. Please use the `output_destination` parameter instead.*

</details>

### Evaluation

Use the evaluation parameters to control what to measure when benchmarking.

{% hint style="success" %}
The SDGym benchmark will always measure performance (time and memory). Use additional parameters to evaluate other aspects of the synthetic data after it's created.
{% endhint %}

**`compute_diagnostic_score:`**&#x53;et this boolean to generate an overall diagnostic score for every synthesizer and dataset. This may increase the benchmarking time.

* (default) `True`: Compute an overall diagnostic score. See the [SDMetrics Diagnostic Report](https://docs.sdv.dev/sdmetrics/reports/diagnostic-report/single-table-api) for more details.
* `False`: Do not compute a diagnostic score.

**`compute_quality_score`**: Set this boolean to generate an overall quality score for every synthesizer and dataset. This may increase the benchmarking time.

* (default) `True`: Compute an overall quality score. See the [SDMetrics Quality Report](https://docs.sdv.dev/sdmetrics/reports/quality-report/single-table-quality-report) for more details.
* `False`: Do not compute a quality score.

**`compute_privacy_score`**: Set this boolean to generate an overall privacy score for every synthesizer and dataset. This may increase the benchmarking time.

* (default) `True`: Compute the privacy score. See the [DCRBaselineProtection metric](https://docs.sdv.dev/sdmetrics/metrics/privacy-metrics/dcrbaselineprotection) for more details.
* `False`: Do not compute a privacy score

**`sdmetrics`**: Provide a list of strings corresponding to metrics from the [SDMetrics library](https://docs.sdv.dev/sdmetrics/metrics/metrics-glossary).

{% hint style="info" %}
To pass in optional parameters, specify a tuple with the metric name followed by a dictionary of parameters and values to pass into the metric.
{% endhint %}

* (default) `None`: Do not apply any additional metrics.
* See the [SDMetrics library](https://docs.sdv.dev/sdmetrics/) for more metric options

## Examples

**Running a quick trial to ensure the benchmark works:**

```python
import sdgym

results = sdgym.benchmark_single_table(
    limit_dataset_size=True,
    timeout=600,
    compute_quality_score=False,
    compute_privacy_score=False
)
```

**Running a detailed benchmark with custom evaluation metrics:**

```python
import sdgym

results = sdgym.benchmark_single_table(
    output_destination='my_sdgym_results/',
    sdmetrics=[
        'MissingValueSimilarity',
        'RangeCoverage'
    ]
)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sdv.dev/sdgym/benchmarking/run/local.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
