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

CI Actually use ccache in CircleCI #30350

Merged
merged 11 commits into from
Nov 26, 2024
Merged

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented Nov 26, 2024

Search for ccache build summary in CircleCI log and you find ccache is not used. This is likely because we are using conda-forge compilers and our current set-up works with system compilers ...

ccache build summary:
Summary:
  Hits:               0 /    0
    Direct:           0 /    0
    Preprocessed:     0 /    0
  Misses:             0
    Direct:           0
    Preprocessed:     0
Primary storage:
  Hits:               0 /    0
  Misses:             0
  Cache size (GB): 0.00 / 0.51 (0.00 %)

Copy link

github-actions bot commented Nov 26, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 4d79cb9. Link to the linter CI: here

@lesteve
Copy link
Member Author

lesteve commented Nov 26, 2024

Ccache is working now and as expected reused in the PR once the first commit builds, see for example this build log:

+ echo 'ccache build summary:'
ccache build summary:
+ ccache -s
Summary:
  Hits:              72 /   72 (100.0 %)
    Direct:          72 /   72 (100.0 %)
    Preprocessed:     0 /    0
  Misses:             0
    Direct:           0
    Preprocessed:     0
  Uncacheable:        6
Primary storage:
  Hits:             144 /  144 (100.0 %)
  Misses:             0
  Cache size (GB): 0.01 / 0.51 (2.01 %)

This probably saves 3-5 minutes to the build time, see this PR commit build logs: https://app.circleci.com/pipelines/github/scikit-learn/scikit-learn?branch=pull%2F30350. First ones are not cached and doc build takes ~16 minutes, last one is cache and take ~12-13 minutes.

I also used -j3 to stick to the default ninja parallelism rule as mentioned in #30333:

  • 1 core -> 2 ninja process
  • 2 cores -> 3 ninja process
  • n_cores -> n_cores + 2 ninja processes

I tried -j3 vs -j2 it does not seem to make a difference time information is about 1 minutes when fully cached (which I would say is most of the cases):

real    0m57.945s
user    1m40.114s
sys     0m11.052s

@lesteve lesteve added the Quick Review For PRs that are quick to review label Nov 26, 2024
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Nice to have.

@glemaitre glemaitre merged commit caaa1f5 into scikit-learn:main Nov 26, 2024
34 checks passed
@glemaitre
Copy link
Member

Thanks @lesteve

@lesteve lesteve deleted the doc-build-ccache branch December 2, 2024 13:56
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request Dec 4, 2024
jeremiedbb pushed a commit that referenced this pull request Dec 6, 2024
virchan pushed a commit to virchan/scikit-learn that referenced this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build / CI Quick Review For PRs that are quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants