Lazy object copy as a platform for population-based probabilistic programming

This work considers dynamic memory management for population-based probabilistic programs, such as those using particle methods for inference. Such programs exhibit a pattern of allocating, copying, potentially mutating, and deallocating collections of similar objects through successive generations....

Full description

Bibliographic Details
Main Author: Murray, Lawrence M.
Format: Article in Journal/Newspaper
Language:unknown
Published: arXiv 2020
Subjects:
Online Access:https://dx.doi.org/10.48550/arxiv.2001.05293
https://arxiv.org/abs/2001.05293
id ftdatacite:10.48550/arxiv.2001.05293
record_format openpolar
spelling ftdatacite:10.48550/arxiv.2001.05293 2023-05-15T18:32:44+02:00 Lazy object copy as a platform for population-based probabilistic programming Murray, Lawrence M. 2020 https://dx.doi.org/10.48550/arxiv.2001.05293 https://arxiv.org/abs/2001.05293 unknown arXiv arXiv.org perpetual, non-exclusive license http://arxiv.org/licenses/nonexclusive-distrib/1.0/ Distributed, Parallel, and Cluster Computing cs.DC FOS Computer and information sciences Article CreativeWork article Preprint 2020 ftdatacite https://doi.org/10.48550/arxiv.2001.05293 2022-03-10T16:15:06Z This work considers dynamic memory management for population-based probabilistic programs, such as those using particle methods for inference. Such programs exhibit a pattern of allocating, copying, potentially mutating, and deallocating collections of similar objects through successive generations. These objects may assemble data structures such as stacks, queues, lists, ragged arrays, and trees, which may be of random, and possibly unbounded, size. For the simple case of $N$ particles, $T$ generations, $D$ objects, and resampling at each generation, dense representation requires $O(DNT)$ memory, while sparse representation requires only $O(DT+DN\log DN)$ memory, based on existing theoretical results. This work describes an object copy-on-write platform to automate this saving for the programmer. The core idea is formalized using labeled directed multigraphs, where vertices represent objects, edges the pointers between them, and labels the necessary bookkeeping. A specific labeling scheme is proposed for high performance under the motivating pattern. The platform is implemented for the Birch probabilistic programming language, using smart pointers, hash tables, and reference-counting garbage collection. It is tested empirically on a number of realistic probabilistic programs, and shown to significantly reduce memory use and execution time in a manner consistent with theoretical expectations. This enables copy-on-write for the imperative programmer, lazy deep copies for the object-oriented programmer, and in-place write optimizations for the functional programmer. Article in Journal/Newspaper The Pointers DataCite Metadata Store (German National Library of Science and Technology)
institution Open Polar
collection DataCite Metadata Store (German National Library of Science and Technology)
op_collection_id ftdatacite
language unknown
topic Distributed, Parallel, and Cluster Computing cs.DC
FOS Computer and information sciences
spellingShingle Distributed, Parallel, and Cluster Computing cs.DC
FOS Computer and information sciences
Murray, Lawrence M.
Lazy object copy as a platform for population-based probabilistic programming
topic_facet Distributed, Parallel, and Cluster Computing cs.DC
FOS Computer and information sciences
description This work considers dynamic memory management for population-based probabilistic programs, such as those using particle methods for inference. Such programs exhibit a pattern of allocating, copying, potentially mutating, and deallocating collections of similar objects through successive generations. These objects may assemble data structures such as stacks, queues, lists, ragged arrays, and trees, which may be of random, and possibly unbounded, size. For the simple case of $N$ particles, $T$ generations, $D$ objects, and resampling at each generation, dense representation requires $O(DNT)$ memory, while sparse representation requires only $O(DT+DN\log DN)$ memory, based on existing theoretical results. This work describes an object copy-on-write platform to automate this saving for the programmer. The core idea is formalized using labeled directed multigraphs, where vertices represent objects, edges the pointers between them, and labels the necessary bookkeeping. A specific labeling scheme is proposed for high performance under the motivating pattern. The platform is implemented for the Birch probabilistic programming language, using smart pointers, hash tables, and reference-counting garbage collection. It is tested empirically on a number of realistic probabilistic programs, and shown to significantly reduce memory use and execution time in a manner consistent with theoretical expectations. This enables copy-on-write for the imperative programmer, lazy deep copies for the object-oriented programmer, and in-place write optimizations for the functional programmer.
format Article in Journal/Newspaper
author Murray, Lawrence M.
author_facet Murray, Lawrence M.
author_sort Murray, Lawrence M.
title Lazy object copy as a platform for population-based probabilistic programming
title_short Lazy object copy as a platform for population-based probabilistic programming
title_full Lazy object copy as a platform for population-based probabilistic programming
title_fullStr Lazy object copy as a platform for population-based probabilistic programming
title_full_unstemmed Lazy object copy as a platform for population-based probabilistic programming
title_sort lazy object copy as a platform for population-based probabilistic programming
publisher arXiv
publishDate 2020
url https://dx.doi.org/10.48550/arxiv.2001.05293
https://arxiv.org/abs/2001.05293
genre The Pointers
genre_facet The Pointers
op_rights arXiv.org perpetual, non-exclusive license
http://arxiv.org/licenses/nonexclusive-distrib/1.0/
op_doi https://doi.org/10.48550/arxiv.2001.05293
_version_ 1766216911218016256