Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cubed talk at SciPy 2025

Avatar for Tom Nicholas Tom Nicholas
July 09, 2025
10

Cubed talk at SciPy 2025

Avatar for Tom Nicholas

Tom Nicholas

July 09, 2025
Tweet

Transcript

  1. What I will talk about: - Vision for Science at

    Scale - What is Cubed? - Xarray integration - Initial results - Pros and Cons - Next steps
  2. Tale of two Toms: Tom White Tom Nicholas - Xarray

    core dev - Background in Plasma Physics + Oceanography - Now engineer at Earthmover - Sgkit developer - Hadoop maintainer - Cubed main developer
  3. Vision for Science at Scale (Tom’s 🎄 list 🎁 )

    - My perfect parallel executor…
  4. Vision for Science at Scale (Tom’s 🎄 list 🎁 )

    - (1) - Expressive - Scale without rewriting - Perfect weak horizontal scaling - (1000x problem in 1x time with 1000x CPUs) - Predictable (no nasty RAM surprises) - Robust to small failures
  5. Vision for Science at Scale (Tom’s 🎄 list 🎁 )

    - (2) - … - Resumable - Forget about the Cluster - Fully open - Not locked in to any one service or platform
  6. Bounded-memory operations - Blockwise processes one chunk at a time

    - Rechunk can be constant memory if spilling to intermediate Zarr store - (see pangeo Rechunker package)
  7. Serverless execution - Every op is (a series of) embarrassingly

    parallel tasks - Just launch them all simultaneously - Ideal fit for ✨Serverless✨ cloud services - e.g. AWS Lambda, Google Cloud Functions - (Means no cluster to manage!)
  8. Start on your Laptop - Process hundreds of GB on

    your laptop using all available cores
  9. Benchmark: “Quadratic Means” problem - Reduction computation - Input: 1.5TB

    - Time: 1m 40s - Lithops on AWS Lambda with 1000 workers
  10. Benchmark: Rechunking ERA5 dataset variable - All-to-all rechunk - Multi-stage

    algorithm - Input: 1.5TB - Time: 8m 48s - Lithops on AWS Lambda with 1000 workers
  11. Benchmark: Rechunking ERA5 dataset variable - Actual memory usage is

    always less than allowed maximum - Room to optimize further
  12. Xarray Integration - Xarray has been generalized to wrap any

    chunked array type - Install cubed & cubed-xarray - Then specify the allowed memory - (And the location for intermediate Zarr stores) from cubed import Spec spec = Spec(work_dir='tmp', allowed_mem='1GB')
  13. Xarray Integration - Now you can directly open from disk

    as cubed.Array objects ds = open_dataset( 'data.zarr', chunked_array_type='cubed', from_array_kwargs={'spec': spec}) chunks={}, )
  14. Xarray Integration - Now just .compute, with your chosen serverless

    Executor! from cubed.runtime.executors.lithops import LithopsExecutor ds.compute(executor=LithopsExecutor())
  15. Vision for Science at Scale (Tom’s 🎄 list 🎁 )

    - Expressive - No Cluster - Predictable RAM usage - Retry failures - Resumable - Horizontal scaling - Fully open
  16. Disadvantages - I/O to Zarr is slow compared to ideal

    dask case of staying in RAM - Serverless more expensive per CPU-hour - Only array operations
  17. Next steps - We want your use cases to test

    on! - Optimizations - Other array types (JAX on GPU) - Other storage layers (obstore, zarrs-python)