<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Towards Efficient Python Interpreter for Tiered Memory Systems</title></titleStmt>
			<publicationStmt>
				<publisher>Poster and Work-in-Progress in Proceedings of the 21st USENIX Conference on File and Storage Technologies (FAST)</publisher>
				<date>02/27/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10495643</idno>
					<idno type="doi"></idno>
					<title level='j'>Poster and Work-in-Progress in Proceedings of the 21st USENIX Conference on File and Storage Technologies (FAST)</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Yuze Li</author><author>Shunyu Yao</author><author>Jaiaid Mobin</author><author>M. Mustafa Rafique</author><author>Dimitrios Nikolopoulos</author><author>Kirshanthan Sundararajah</author><author>Huaicheng Li</author><author>Ali R Butt</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Tiered Memory Systems</head><p>The emergence of low-latency non-DDR technologies offers cheaper $/GB memory cost. Running modern data-intensive applications in tiered memory systems experiences different percentage of slowdown. The principle is to track data access frequencies and automatically migrates them among tiered memory resources. Thus, a good solution must be:</p><p>Accuracy: Be precise about the memory boundaries to be hot or cold.</p><p>Low overhead: Solutions should not interfere with applications that much.</p><p>Portability: Can readily be deployed to today's cloud.</p><p>Transparency: No need for program re-writing, static analysis.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Problem of Existing Solutions</head><p>OS level: Page table entry checking, hardware event sampling, LRU, AutoNUMA, etc.</p><p>Coarse-grained observation point: Sub-page information, and application semantics cannot be extracted.</p><p>Unbalanced accuracy and overhead: By increasing the accuracy, overhead will increase</p><p>Runtime level: Defines new programming models through APIs, source code static analysis, and profiling.</p><p>lack of transparency: Involves non-trivial programmer efforts, or exhaustive profiling.</p><p>None of the existing methods can be directly ported to the popular language, Python, considering Python's top-ranking position in 2023.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Challenges of Tracking Python Object Temperatures</head><p>Challenge 1: Method of Tracing Unlike C++, CPython does not offer smart pointer and operator overloading.</p><p>Unlike JVM-based runtime, CPython does not have read-write barriers to instrument.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Challenge 2: Tracing Overhead</head><p>CPython only maintains the references of container PyObjects, obtaining all PyObjects references requires the GIL held (application paused).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Challenge 3: Handling Native Calls</head><p>CPython does not capture runtime semantics in native executions (C/C++).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Major Insights</head><p>Insight 1: Reference counting can be a potential indicator to infer PyObjects accesses (challenge 1).</p><p>Insight 2: The set of live PyObjects is not likely to change until a cyclic-GC is triggered; selectively tracing based on object semantics (challenge 2). Pypper comprises a control layer and a metadata layer. The control layer populates and analyzes the metadata.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Pypper Overview</head><p>1. Invoked from Python API (Pypper.start()), tracing enabled within CPython main thread. 2. Live trace cascade traverses the cyclic-GC list to get all PyObjects references. 3. Pypper triggers a separate CPython thread for consecutive active traces, and records refcnt changes for each observed PyObject. 4. Mapping algorithm inspects the captured refcnt changes to infer the real PyObject temperatures. 5. Migration plane merges hot/cold objects into compact segregated memory ranges, aligns them to page boundaries, before migrating to designated areas. 6. Upon receiving stop signal (Pypper.end()), Pypper frees metadata, resets states, stops tracing.  Takeaway: The reference counting in the GC scheme can also be used to infer object temperatures by defining a mapping model.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Preliminary Results</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>WiP and Future Work</head><p>Live Trace Overhead Mitigation (WiP)</p><p>Make the best use of CPython's cyclic-GC module by only traversing newly survived container PyObjs. Filter live PyObjs by observing their semantics, e.g., length, depths.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Mapping Algorithm (WiP)</head><p>A fine-grained mapping module from refcnt-changing to real object temperatures is yet to be defined.</p><p>Handling Native Executions (future work)</p><p>Pypper should distinguish and handle native execution that is not based on refcnt changes.</p></div></body>
		</text>
</TEI>
