Repository navigation
perf(planner): the snow bake runs its chunks on every core and keeps its tiles on disk - #2734
Merged
Merged
Conversation
…its tiles on disk The snow step baked its zoom-9 chunks in four threads. Most of their work holds the Python interpreter lock, so the DACH bake of 2026-10-17 ran at 1.49 CPU seconds per second for 8.7 hours: one chunk each 81 s, 374 chunks. Each chunk now bakes in a worker process, one per core. The workers fork from the bake, so they read the planes of the sources without a copy. The tiles of a chunk go to a file beside the output, and the archive takes them in tile order, so the bytes do not depend on which chunk ends first. The tiles no longer wait in a dict: the step held 4 GiB of them in RAM until the end. The command line keeps four workers when it reads HR-WSI from CDSE S3, which allows four connections per user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…e machine Review fixes: - The finished futures held every chunk's tiles until the bake returned: the list of futures is gone, and `as_completed` lets go of each. - A worker ends when the bake process ends, also on SIGKILL (PR_SET_PDEATHSIG); before, idle workers outlived an out-of-memory kill and kept their memory. - The default worker count follows the cores that the process can use and is at most one per GB of free memory: a worker holds about 0.6 GB. - Outside Linux the chunks bake in threads, because a fork is not safe on macOS. On the synthetic inputs of the pull request the bytes are the same as on develop, and the parent peaks at 69 to 77 MiB instead of 183 to 201 MiB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/planner_snow.pybakes each zoom-9 chunk in a worker process, one per core. Before, it used 4 threads.Why
On the DACH bake of 2026-10-17 (
runs/2026-10-17-071235),planner/snowran alone for 8.7 h:transform_boundson every file for every chunk.Estimate, not measured on DACH. About 60 CPU-s per chunk remain after #2730.
This is finding 4 of the bake system review.
Memory note
Each worker holds the planes of one chunk: about 0.5 GB for HR-WSI at 20 m. That is an estimate from the chunk size. On 12 cores, a worker peak of 0.5 GB means 6 GB in all.
The receipt shows
ru_maxrss: the peak of the largest process, not the sum of the processes. The engine review (finding 1) proposes per-step processes. A cgroupmemory.peakwould count the sum.Tests
9269efeb…bbe6e18a…tools/testssuite, as CI runs it (--group dev --group planner-snow --group planner-sun): 331 tests OK. There are no fork warnings.test_the_bake_reads_one_zoom_9_chunk_and_stores_to_the_max_zoomnow counts reads through a file, because a chunk reads in a worker process.Not run: a real snow bake, because the machine runs other work.
Public docs: no change.
Review round
An adversarial review confirmed that old and new give the same bytes on four more synthetic inputs. It also found the issues below; all are fixed in cacf667.
as_completedlets go of each future. On the inputs above, the parent now peaks at 69 to 77 MiB, against 183 to 201 MiB on develop.PR_SET_PDEATHSIG. I killed a running bake with SIGKILL and both of its workers ended.sched_getaffinity) and is at most one worker per GB of free memory. A worker holds about 0.6 GB for nine seasons.The receipt still records the peak of the largest process, not the sum of the workers. That is finding 1 of the review: the session "Run every obc data step in its own process" works on it.
Requirements: none
🤖 Generated with Claude Code