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

[query] Benchmark configurations #14762

Open
wants to merge 1 commit into
base: ehigham/benchmark-in-batch-variability
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hail/python/benchmark/hail/benchmark_benchmark_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from benchmark.tools.statistics import analyze_benchmarks


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.2, instances=10, iterations=5, burn_in_iterations=10)
def benchmark_analyze_benchmarks(local_tmpdir, onethreetwo, onethreethree):
inputs = (onethreetwo, onethreethree)
inputs = ((v, Path(tempfile.mktemp(dir=local_tmpdir))) for v in inputs)
Expand Down
10 changes: 5 additions & 5 deletions hail/python/benchmark/hail/benchmark_combiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ def benchmark_compile_2k_merge(empty_gvcf, tmp_path):
hl.vds.write_variant_datasets(combined, str(tmp_path / 'combiner-multi-write'), overwrite=True)


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.1, instances=10, iterations=10, burn_in_iterations=10)
@pytest.mark.xtimeout(270)
def benchmark_python_only_10k_transform(empty_gvcf):
for vcf in [import_vcf(empty_gvcf)] * 10_000:
transform_gvcf(vcf, [])


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.1, instances=10, iterations=10, burn_in_iterations=20)
def benchmark_python_only_10k_combine(empty_gvcf):
vcf = import_vcf(empty_gvcf)
mt = transform_gvcf(vcf, [])
for mts in chunk(COMBINE_GVCF_MAX, [mt] * 10_000):
combine_variant_datasets(mts)


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.1, instances=20, iterations=10, burn_in_iterations=10)
def benchmark_import_and_transform_gvcf(single_gvcf):
mt = import_vcf(single_gvcf)
vds = transform_gvcf(mt, [])
vds.reference_data._force_count_rows()
vds.variant_data._force_count_rows()


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.2, instances=10, iterations=15, burn_in_iterations=8)
def benchmark_import_gvcf_force_count(single_gvcf):
mt = import_vcf(single_gvcf)
mt._force_count_rows()
Expand All @@ -62,7 +62,7 @@ def tmp_and_output_paths(tmp_path):
return (tmp, output)


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.1, instances=10, iterations=5, burn_in_iterations=10)
@pytest.mark.xtimeout(180)
def benchmark_vds_combiner_chr22(chr22_gvcfs, tmp_and_output_paths):
parts = hl.eval([hl.parse_locus_interval('chr22:start-end', reference_genome='GRCh38')])
Expand Down
15 changes: 8 additions & 7 deletions hail/python/benchmark/hail/benchmark_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@ def benchmark_block_matrix_nested_multiply(tmp_path):
bm.write(str(tmp_path / 'result.mt'), overwrite=True)


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.2, instances=10, iterations=5, burn_in_iterations=5)
def benchmark_make_ndarray():
ht = hl.utils.range_table(200_000)
ht = ht.annotate(x=hl.nd.array(hl.range(ht.idx)))
ht._force_count()


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.2, instances=10, iterations=20, burn_in_iterations=10)
def benchmark_ndarray_addition():
arr = hl.nd.ones((1024, 1024))
hl.eval(arr + arr)


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.2, instances=20, iterations=5, burn_in_iterations=10)
def benchmark_ndarray_matmul_int64():
arr = hl.nd.arange(1024 * 1024).map(hl.int64).reshape((1024, 1024))
hl.eval(arr @ arr)


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.1, instances=20, iterations=15, burn_in_iterations=6)
def benchmark_ndarray_matmul_float64():
arr = hl.nd.arange(1024 * 1024).map(hl.float64).reshape((1024, 1024))
hl.eval(arr @ arr)


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.2, instances=10, iterations=5, burn_in_iterations=10)
@pytest.mark.xtimeout(200)
def benchmark_blockmatrix_write_from_entry_expr_range_mt(tmp_path):
mt = hl.utils.range_matrix_table(40_000, 40_000, n_partitions=4)
Expand All @@ -55,13 +55,14 @@ def benchmark_blockmatrix_write_from_entry_expr_range_mt_standardize(tmp_path):
)


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.1, instances=5, iterations=8, burn_in_iterations=10)
@pytest.mark.xtimeout(200)
def benchmark_sum_table_of_ndarrays():
ht = hl.utils.range_table(400).annotate(nd=hl.nd.ones((4096, 4096)))
ht.aggregate(hl.agg.ndarray_sum(ht.nd))


@pytest.mark.benchmark()
@pytest.mark.benchmark(mds=1.1, instances=10, iterations=5, burn_in_iterations=4)
@pytest.mark.xtimeout(250)
def benchmark_block_matrix_to_matrix_table_row_major():
mt = hl.utils.range_matrix_table(20_000, 20_000, n_partitions=4)
Expand Down
Loading