37 COSMO: Computing with Stochastic Numbers in Memory SARANSH GUPTA, University of California, San Diego MOHSEN IMANI, University of California, Irvine JOONSEOP SIM, ANDREW HUANG, FAN WU, and JAEYOUNG KANG, University of California, San Diego YESEONG KIM, Daegu Gyeongbuk Institue of Science and Technology TAJANA ŠIMUNIĆ ROSING, University of California, San Diego Stochastic computing (SC) reduces the complexity of computation by representing numbers with long streams of independent bits. However, increasing performance in SC comes with either an increase in area or a loss in accuracy. Processing in memory (PIM) computes data in-place while having high memory density and support- ing bit-parallel operations with low energy consumption. In this article, we propose COSMO, an architecture for co mputing with s tochastic numbers in memo ry, which enables SC in memory. The proposed architecture is general and can be used for a wide range of applications. It is a highly dense and parallel architecture that supports most SC encodings and operations in memory. It maximizes the performance and energy efficiency of SC by introducing several innovations: (i) in-memory parallel stochastic number generation, (ii) efficient implication-based logic in memory, (iii) novel memory bit line segmenting, (iv) a new memory-compatible SC addition operation, and (v) enabling flexible block allocation. To show the generality and efficiency of our stochastic architecture, we implement image processing, deep neural networks (DNNs), and hyperdimensional (HD) computing on the proposed hardware. Our evaluations show that running DNN inference on COSMO is 141 × faster and 80× more energy efficient as compared to GPU. CCS Concepts: • Hardware Emerging architectures; Non-volatile memory;• Computer systems organi- zation Neural networks; Additional Key Words and Phrases: Stochastic computing, computing in memory, processing in memory, mem- ristors, reram, neural networks, hyperdimensional computing, image processing ACM Reference format: Saransh Gupta, Mohsen Imani, Joonseop Sim, Andrew Huang, Fan Wu, Jaeyoung Kang, Yeseong Kim, and Ta- jana Šimuni´ c Rosing. 2022. COSMO: Computing with Stochastic Numbers in Memory. J. Emerg. Technol. Comput. Syst. 18, 2, Article 37 (January 2022), 25 pages. https://doi.org/10.1145/3484731 This work was supported in part by CRISP, one of six centers in JUMP, an SRC program sponsored by DARPA, in part by SRC-Global Research Collaboration grant, Office of Naval Research grant # N00014-21-1-2225, and also NSF grants # 1527034, # 1730158, # 1826967, # 1911095, and # 2127780. Authors’ addresses: S. Gupta, University of California, San Diego, La Jolla, CA 92093; email: sgupta@ucsd.edu; M. Imani, University of California, Irvine, CA 92697; email: m.imani@uci.edu; J. Sim, A. Huang, F. Wu, J. Kang, and T. Š. Rosing, University of California, San Diego, La Jolla, CA 92093; emails: {j7sim, anh162, f2wu}@ucsd.edu, j5kang@eng.ucsd.edu, tajana@ucsd.edu; Y. Kim, Daegu Gyeongbuk Institue of Science and Technology, Daegu 333, Republic of Korea; email: yeseongkim@dgist.ac.kr. This work is licensed under a Creative Commons Attribution International 4.0 License. © 2022 Copyright held by the owner/author(s). 1550-4832/2022/01-ART37 $15.00 https://doi.org/10.1145/3484731 ACM Journal on Emerging Technologies in Computing Systems, Vol. 18, No. 2, Article 37. Pub. date: January 2022.