Rockmate: an Efficient, Fast, Automatic and Generic Tool for Re-materialization in PyTorch
We propose Rockmate to control the memory requirements when training PyTorch DNN models. Rockmate is an automatic tool that starts from the model code and generates an equivalent model, using a predefined amount of memory for activations, at the cost of a few re-computations. Rockmate automatically detects the structure of computational and data dependencies and rewrites the initial model as a sequence of complex blocks. We show that such a structure is widespread and can be found in many models in the literature (Transformer based models, ResNet, RegNets,...). This structure allows us to solve the problem in a fast and efficient way, using an adaptation of Checkmate (too slow on the whole model but general) at the level of individual blocks and an adaptation of Rotor (fast but limited to sequential models) at the level of the sequence itself. We show through experiments on many models that Rockmate is as fast as Rotor and as efficient as Checkmate, and that it allows in many cases to obtain a significantly lower memory consumption for activations (by a factor of 2 to 5) for a rather negligible overhead (of the order of 10% to 20%). Rockmate is open source and available at https://github.com/topal-team/rockmate.
Code (1)
Methods 이 논문이 사용한 방법론
Similar Papers 제목 키워드 기반
Morph-KGC: Scalable knowledge graph materialization with mapping partitions
Knowledge graphs are often constructed from heterogeneous data sources, using declarative rules that map them to a target ontology and materializing them into RDF. When these data sources are large, the materialization o…
Data IntegrationKnowledge GraphsKnowledge Graphs Data CurationA Simple extension of Dematerialization Theory: Incorporation of Technical Progress and the Rebound Effect
Dematerialization is the reduction in the quantity of materials needed to produce something useful over time. Dematerialization fundamentally derives from ongoing increases in technical performance but it can be countera…
Moccasin: Efficient Tensor Rematerialization for Neural Networks
The deployment and training of neural networks on edge computing devices pose many challenges. The low memory nature of edge devices is often one of the biggest limiting factors encountered in the deployment of large neu…
Edge-computingFoundry: Template-Based CUDA Graph Context Materialization for Fast LLM Serving Cold Start
Modern LLM service providers increasingly rely on autoscaling and parallelism reconfiguration to respond to rapidly changing workloads, but cold-start latency remains a major bottleneck. While recent systems have reduced…
Coop: Memory is not a Commodity
Tensor rematerialization allows the training of deep neural networks (DNNs) under limited memory budgets by checkpointing the models and recomputing the evicted tensors as needed. However, the existing tensor remateriali…