TL;DR
NotebookOS is a novel notebook platform designed to slash the massive costs of idle GPUs during interactive machine learning sessions. By decoupling GPU allocation from the notebook session lifetime using Raft-replicated kernels and on-demand GPU binding, it achieves up to a 70% reduction in resource costs while maintaining the snappy responsiveness developers expect.
What Problem Does This Paper Address?
Data scientists rely heavily on interactive environments like Jupyter Notebooks and Google Colab for Interactive Deep Learning Training (IDLT)—workflows that involve model debugging, hyperparameter tuning, and rapid, iterative code adjustments.
To guarantee a responsive user experience, modern Notebook-as-a-Service (NaaS) platforms reserve dedicated GPUs for the entire duration of a user's session. However, the authors' analysis of real-world production traces reveals a glaring inefficiency: users spend the vast majority of their session time writing code, reading documentation, or analyzing results while the expensive, reserved GPUs sit completely idle. In fact, reserved GPUs are left idle over 81% of the time, resulting in massive resource waste and prohibitively high cloud infrastructure costs.
Methods
NotebookOS breaks the rigid, one-to-one binding between notebook sessions and GPUs by introducing a Distributed Notebook Kernel architecture.
Instead of running a single kernel process tied to a specific GPU, NotebookOS maps each logical notebook to a distributed cluster of three kernel replicas spread across different physical GPU servers.
Key mechanisms include:
- Dynamic GPU Binding: GPUs are never exclusively assigned to a notebook session long-term. Instead, they are dynamically allocated and bound to a kernel replica container only during active cell execution, and are immediately released once the task finishes.
- Raft-Driven State Machine Replication (SMR): To ensure a seamless user experience when switching between replicas, NotebookOS uses the Raft consensus protocol to synchronize small Python CPU-memory states (like variables and execution context) completely off the critical path.
- Lightweight Executor Election: When a user submits a cell for execution, a fast election protocol determines which replica has immediate access to GPU resources to run the code.
- Hybrid Storage for Large Objects: To keep the Raft log lean, large objects like model weights and training datasets are checkpointed asynchronously to a distributed data store (such as AWS S3, Redis, or HDFS).
Datasets
The paper evaluates NotebookOS using a mix of production traces and standard deep learning benchmarks:
- AdobeTrace: A real-world production dataset containing 545,467 individual training events collected from an internal Adobe research notebook cluster (spanning June–August 2021).
- Baseline Traces: The authors compare AdobeTrace against traditional batch deep learning traces, specifically Microsoft's PhillyTrace and Alibaba's AlibabaTrace (2020).
- Evaluation Benchmarks: For prototype testing, the authors ran workloads across multiple domains using standard models (VGG-16, ResNet-18, Inception v3, BERT, GPT-2, Deep Speech 2) and datasets (CIFAR-10/100, Tiny ImageNet, IMDb, CoLA, LibriSpeech).
Key Insights and Ideas
- IDLT Workloads are Distinct from Batch Jobs: Traditional cluster schedulers optimize for long-running batch jobs that require uninterrupted GPU access. NotebookOS recognizes that IDLT tasks are fundamentally different: 75% of tasks finish in under 5 minutes, and the time between tasks (inter-arrival time) is long—often 5 to 8 minutes.
- Oversubscription is Safe and Effective: Because of the long idle gaps between cell executions, servers can safely oversubscribe GPU resources. Replicating the notebook kernel ensures that if one server experiences resource contention, another replica on a less loaded server can step in.
- Hiding State Sync Latency: While replicating Python state across multiple nodes introduces overhead, the long inter-arrival times inherent to human-in-the-loop workflows completely hide this latency from the user.
Key Results
- Massive GPU Savings: In a prototype evaluation replay of a 17.5-hour excerpt of the real-world production trace, NotebookOS saved 1,187 GPU hours compared to the standard reservation model.
- High Interactivity Maintained: NotebookOS achieved nearly identical interactivity delays to the expensive reservation baseline. It successfully reused or found a ready executor replica immediately 89.6% of the time, avoiding cold-start delays.
- Provider Cost Reduction: Long-term simulations over the full 3-month trace demonstrated up to a 69.87% reduction in provider-side costs, significantly boosting profit margins for cloud providers while maintaining user responsiveness.
Limitations and Future Work
- No Fractional GPU Sharing: Currently, NotebookOS allocates whole GPUs exclusively during active cell execution. It does not yet support fine-grained spatial or fractional GPU sharing (e.g., splitting a single GPU among multiple light notebook tasks using tools like HAMi).
- Single-Server Execution Constraints: The system does not natively support multi-server distributed training frameworks (like Ray) out of the box, though the authors note this could be integrated in future iterations.
- CPU-Only Optimization: The authors suggest that future work could leverage stateful serverless scheduling techniques to further optimize and parallelize CPU-only notebook cell executions.
Summary updated