Releasing Execution Contexts
Crystal replaces its preview MT model with Execution Contexts, an interface for orchestrating fibers across threads with three built-in types: Concurrent (one thread at a time), Parallel (work-stealing, auto-scaling up to a configured maximum roughly every 100 ms), and Isolated (a fiber owns a thread). The default context is parallel with parallelism 1, so existing apps stay single-threaded until they call resize, and CRYSTAL_WORKERS is no longer read automatically. Breaking changes: fibers can migrate between threads, schedulers can hop threads during blocking syscalls like getaddrinfo (which affects thread-locals and main-thread-bound C libraries), and spawn(same_thread: true) now raises in parallel contexts. The without_mt and preview_mt flags revert to the legacy schedulers for now.
Related posts
- Accelerate ND-Parallel: A guide to Efficient Multi-GPU Training
Hugging Face hardMasterAccelerate's ParallelismConfig, also exposed through Axolotl config fields, lets you compose data parallelism, FSDP, tensor parallelism and context parallelism in one training setup. The guide explains how each strategy trades memory for communication. FSDP shards weights, gradients and optimizer states and gathers each layer when needed. Tensor parallelism splits linear layers column-wise then row-wise so only one all-reduce is required, which makes it best kept within a single NVLink node. Context parallelism shards the sequence and uses RingAttention so very long contexts fit in memory. It then covers hybrid combinations such as HSDP, FSDP+TP and FSDP+CP, with guidance on matching each parallelism degree to intra-node versus inter-node bandwidth.
- Unlocking asynchronicity in continuous batching
Hugging Face hardMasterSynchronous continuous batching makes the CPU and GPU take turns, and profiling an 8B model generating 8K tokens at batch size 32 shows the GPU idle for 24% of the 300.6-second runtime while the CPU prepares batches. Asynchronous batching overlaps preparation of batch N+1 with compute of batch N. It does this with three non-default CUDA streams (H2D, compute, D2H) ordered by CUDA events, plus double-buffered input/output slots to avoid race conditions. The design, implemented in transformers' continuous batching, needs no kernel or model changes. It must also carry tokens produced by batch N into batch N+1's inputs.
- Announcing Silk: a silky smooth fiber runtime for ClickHouse
ClickHouse hardMaster
Silk is a C++ stackful-fiber runtime for ClickHouse. It pins one scheduler thread per CPU, uses io_uring as its I/O foundation, steals work in order of CPU topology cost (hyperthread sibling, then same socket, then cross-socket), and does zero heap allocation in the steady-state hot path through mmap'd stack pools, stack-resident futures and intrusive containers. Its benchmarks report about 3.6 ns per yield, 5.9M file IOPS and roughly 4-15x boost::asio throughput, and it argues that Photon's cache-aliasing penalty comes from slab-allocated stacks rather than from stackful fibers. The tradeoffs are that it runs only on Linux, uses a process-wide singleton scheduler and caps fiber parameters at 64 bytes. Its first target is ClickHouse's distributed cache, where internal tests showed about 65% better p99.9 latency than a thread pool.
- Native Async/Coroutine Reads in RocksDB
RocksDB Blog hardMasterRocksDB 11.10.0 adds experimental native asynchronous Get/MultiGet APIs (callback-based GetAsync/MultiGetAsync and Folly-task-based CoroDB::CoGet/CoMultiGet) that suspend a read at the SST block-miss filesystem boundary and resume it on the same io_uring-backed EventBase thread, so a small read executor can sustain high storage queue depth without one parked thread per read. Per-request PerfContext/IOStatsContext are swapped in and out of TLS via Folly RequestContext, with CPU time counted only during active slices. Benchmarks on four cores with an 11 GB direct-I/O dataset show coroutines losing ~14% at low concurrency with single-key lookups but gaining up to 305% over threads with larger batches, and 8–55% over the older ReadOptions::async_io path at 20+ tasks.
- To Thread or Not to Thread: An In-Depth Look at Ruby’s Execution Models
Shopify Engineering mediumAdeptThreaded Ruby servers like Puma and Sidekiq save memory over forking servers, but the gap is smaller than RSS suggests once copy-on-write sharing is measured properly with PSS and /proc/$PID/smaps_rollup. In one Shopify production app an extra Unicorn worker cost about 427MiB versus about 257MiB for an extra thread, not the ~750MiB RSS implied, and preloading plus eager loading improves CoW efficiency. Processes still offer clean request timeouts and avoid Global VM Lock contention, which hurts latency more than commonly assumed because Ruby web requests are less I/O-heavy than believed and GC also holds the GVL. Ractors and Fibers are not drop-in replacements, and a proposed GVL instrumentation API for Ruby 3.2 would let teams measure the latency cost of threads.