tskit icon indicating copy to clipboard operation
tskit copied to clipboard

CI time

Open benjeffery opened this issue 1 year ago • 9 comments

CI execution time has creeped back up to over half an hour - I'm seeing some that are 50min. This isn't ideal, would be good to get it back under 20min.

benjeffery avatar Oct 16 '24 10:10 benjeffery

That's far too much - can you post a timing of the tests please?

jeromekelleher avatar Oct 16 '24 10:10 jeromekelleher

Here are the top 50. Usual stats suspects.

39.60s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_wright_fisher_initial_generation
38.60s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_wright_fisher_initial_generation
38.07s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_wright_fisher_unsimplified
37.21s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_wright_fisher_unsimplified
21.29s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_many_trees
20.65s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_many_trees
17.11s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_wright_fisher_unsimplified_multiple_roots
17.08s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_wright_fisher_unsimplified_multiple_roots
15.49s call     tests/test_haplotype_matching.py::TestSimulationExamples::test_continuous_genome[100-50]
15.30s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_wright_fisher_initial_generation_no_deep_history
15.27s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_wright_fisher_initial_generation_no_deep_history
12.25s call     tests/test_tree_stats.py::TestSiteTraitLinearModel::test_many_trees_sequence_length_infinite_sites
12.21s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_wright_fisher_simplified
11.98s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_wright_fisher_simplified
10.25s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_short_sequence_length
10.07s call     tests/test_tree_stats.py::TestNodeTraitCorrelation::test_wright_fisher_initial_generation
10.05s call     tests/test_tree_stats.py::TestBranchTraitCorrelation::test_wright_fisher_initial_generation
10.03s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_short_sequence_length
9.59s call     tests/test_tree_stats.py::TestNodeTraitCorrelation::test_wright_fisher_unsimplified
9.28s call     tests/test_tree_stats.py::TestBranchTraitCorrelation::test_wright_fisher_unsimplified
8.17s call     tests/test_tables.py::TestUnionTables::test_examples
7.91s call     tests/test_tree_stats.py::TestBranchTraitCorrelation::test_normalisation
7.83s call     tests/test_tree_stats.py::TestNodeGeneticRelatednessWeighted::test_wright_fisher_unsimplified
7.70s call     tests/test_topology.py::TestSimplify::test_many_multiroot_trees_recurrent_mutations
7.59s call     tests/test_tree_stats.py::TestBranchTraitCovariance::test_wright_fisher_initial_generation
7.35s call     tests/test_tree_stats.py::TestNodeGeneticRelatednessWeighted::test_wright_fisher_initial_generation
7.31s call     tests/test_tree_stats.py::TestBranchTraitCovariance::test_wright_fisher_unsimplified
6.66s call     tests/test_tree_stats.py::TestNodeTraitCovariance::test_wright_fisher_unsimplified
6.35s call     tests/test_tree_stats.py::TestNodeTraitCovariance::test_wright_fisher_initial_generation
6.34s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_wright_fisher_simplified_multiple_roots
6.26s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_wright_fisher_simplified_multiple_roots
6.22s call     tests/test_tree_stats.py::TestNodeTraitCorrelation::test_normalisation
6.00s call     tests/test_haplotype_matching.py::TestSimulationExamples::test_continuous_genome[100-10]
5.52s call     tests/test_tree_stats.py::TestSiteTraitLinearModel::test_single_tree_jukes_cantor
5.12s call     tests/test_tree_stats.py::TestBranchTraitCorrelation::test_many_trees
4.93s call     tests/test_tree_stats.py::TestNodeTraitLinearModel::test_single_tree_multiple_roots
4.81s call     tests/test_tree_stats.py::TestBranchTraitLinearModel::test_single_tree_multiple_roots
4.52s call     tests/test_tables.py::TestUnionTables::test_no_add_pop
4.36s call     tests/test_ld_matrix.py::test_ld_matrix[pi2_unbiased-n=2_m=32_rho=0]
4.34s call     tests/test_ld_matrix.py::test_ld_matrix[Dz_unbiased-n=2_m=32_rho=0]
4.34s call     tests/test_tree_stats.py::TestNodeTraitCorrelation::test_many_trees
4.29s call     tests/test_ld_matrix.py::test_ld_matrix[D2_unbiased-n=2_m=32_rho=0]
4.20s call     tests/test_ld_matrix.py::test_ld_matrix[r2-n=2_m=32_rho=0]
4.17s call     tests/test_tree_stats.py::TestNodeGeneticRelatedness::test_wright_fisher_initial_generation
4.07s call     tests/test_tree_stats.py::TestBranchTraitCovariance::test_many_trees
4.06s call     tests/test_tree_stats.py::TestSiteTraitLinearModel::test_many_trees_infinite_sites
4.04s call     tests/test_tree_stats.py::TestSiteTraitLinearModel::test_wright_fisher_unsimplified_multiple_roots
4.02s call     tests/test_tree_stats.py::TestNodeGeneticRelatednessWeighted::test_many_trees
4.00s call     tests/test_tree_stats.py::TestNodeTraitCorrelation::test_wright_fisher_unsimplified_multiple_roots
3.99s call     tests/test_tree_stats.py::TestNodeTraitCovariance::test_many_trees

benjeffery avatar Oct 16 '24 10:10 benjeffery

For the top hit almost all the time is spent in node_trait_linear_model at tests/test_tree_stats.py:5404 running the np.isin on 5404.

benjeffery avatar Oct 16 '24 10:10 benjeffery

I've found a 2x here, will PR.

benjeffery avatar Oct 16 '24 11:10 benjeffery

Looking at the numbers windows is taking twice as long. No idea why!

benjeffery avatar Oct 16 '24 15:10 benjeffery

Looking at the numbers windows is taking twice as long. No idea why!

What do you mean?

Some of this is certainly caused by me. In particular, in a recent PR I noticed that the mechanism for "only run a random proportion of tests" in test_tree_stats.py was not working.

petrelharp avatar Oct 16 '24 22:10 petrelharp

What do you mean?

Windows as in the operating system:

Screenshot from 2024-10-17 00-22-55

benjeffery avatar Oct 16 '24 23:10 benjeffery

hah, lol =)

petrelharp avatar Oct 17 '24 15:10 petrelharp

I had in mind to deal with the tree_stats tests when me and Thomas get into doing time windows there.

petrelharp avatar Oct 17 '24 15:10 petrelharp

See suggestion at #264

benjeffery avatar Jun 09 '25 02:06 benjeffery