{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T01:40:57Z","timestamp":1760060457389,"version":"build-2065373602"},"reference-count":36,"publisher":"MDPI AG","issue":"9","license":[{"start":{"date-parts":[[2025,8,29]],"date-time":"2025-08-29T00:00:00Z","timestamp":1756425600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"National Science Foundation","award":["OAC-1931561","OAC-2209892","OAC-2103680","OAC-2004879","OAC-2310548","OAC-2005572","OAC-2411068","OAC-2320345","PHY160053"],"award-info":[{"award-number":["OAC-1931561","OAC-2209892","OAC-2103680","OAC-2004879","OAC-2310548","OAC-2005572","OAC-2411068","OAC-2320345","PHY160053"]}]},{"name":"ACCESS-CI","award":["OAC-1931561","OAC-2209892","OAC-2103680","OAC-2004879","OAC-2310548","OAC-2005572","OAC-2411068","OAC-2320345","PHY160053"],"award-info":[{"award-number":["OAC-1931561","OAC-2209892","OAC-2103680","OAC-2004879","OAC-2310548","OAC-2005572","OAC-2411068","OAC-2320345","PHY160053"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Symmetry"],"abstract":"<jats:p>We present a novel machine learning (ML)-based method to accelerate conservative-to-primitive inversion, focusing on hybrid piecewise polytropic and tabulated equations of state. Traditional root-finding techniques are computationally expensive, particularly for large-scale relativistic hydrodynamics simulations. To address this, we employ feedforward neural networks (NNC2PS and NNC2PL), trained in PyTorch (2.0+) and optimized for GPU inference using NVIDIA TensorRT (8.4.1), achieving significant speedups with minimal accuracy loss. The NNC2PS model achieves L1 and L\u221e errors of 4.54\u00d710\u22127 and 3.44\u00d710\u22126, respectively, while the NNC2PL model exhibits even lower error values. TensorRT optimization with mixed-precision deployment substantially accelerates performance compared to traditional root-finding methods. Specifically, the mixed-precision TensorRT engine for NNC2PS achieves inference speeds approximately 400 times faster than a traditional single-threaded CPU implementation for a dataset size of 1,000,000 points. Ideal parallelization across an entire compute node in the Delta supercomputer (dual AMD 64-core 2.45 GHz Milan processors and 8 NVIDIA A100 GPUs with 40 GB HBM2 RAM and NVLink) predicts a 25-fold speedup for TensorRT over an optimally parallelized numerical method when processing 8 million data points. Moreover, the ML method exhibits sub-linear scaling with increasing dataset sizes. We release the scientific software developed, enabling further validation and extension of our findings. By exploiting the underlying symmetries within the equation of state, these findings highlight the potential of ML, combined with GPU optimization and model quantization, to accelerate conservative-to-primitive inversion in relativistic hydrodynamics simulations.<\/jats:p>","DOI":"10.3390\/sym17091409","type":"journal-article","created":{"date-parts":[[2025,8,29]],"date-time":"2025-08-29T09:08:52Z","timestamp":1756458532000},"page":"1409","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":1,"title":["Machine Learning-Driven Conservative-to-Primitive Conversion in Hybrid Piecewise Polytropic and Tabulated Equations of State"],"prefix":"10.3390","volume":"17","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-2714-6793","authenticated-orcid":false,"given":"Semih","family":"Kacmaz","sequence":"first","affiliation":[{"name":"Department of Physics, University of Illinois Urbana-Champaign, Urbana, IL 61801, USA"},{"name":"National Center for Supercomputing Applications, University of Illinois Urbana-Champaign, Urbana, IL 61801, USA"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-1424-6178","authenticated-orcid":false,"given":"Roland","family":"Haas","sequence":"additional","affiliation":[{"name":"Department of Physics, University of Illinois Urbana-Champaign, Urbana, IL 61801, USA"},{"name":"National Center for Supercomputing Applications, University of Illinois Urbana-Champaign, Urbana, IL 61801, USA"},{"name":"Department of Physics an Astronomy, University of British Columbia, Vancouver, BC V6T 1Z1, Canada"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9682-3604","authenticated-orcid":false,"given":"E. A.","family":"Huerta","sequence":"additional","affiliation":[{"name":"Department of Physics, University of Illinois Urbana-Champaign, Urbana, IL 61801, USA"},{"name":"Data Science and Learning Division, Argonne National Laboratory, Lemont, IL 60439, USA"},{"name":"Department of Computer Science, The University of Chicago, Chicago, IL 60637, USA"}]}],"member":"1968","published-online":{"date-parts":[[2025,8,29]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"95","DOI":"10.1146\/annurev-nucl-013120-114541","article-title":"The Dynamics of Binary Neutron Star Mergers and GW170817","volume":"70","author":"Radice","year":"2020","journal-title":"Annu. Rev. Nucl. Part. Sci."},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"063016","DOI":"10.1103\/PhysRevD.95.063016","article-title":"General relativistic magnetohydrodynamic simulations of binary neutron star mergers forming a long-lived neutron star","volume":"95","author":"Ciolfi","year":"2017","journal-title":"Phys. Rev. D"},{"key":"ref_3","doi-asserted-by":"crossref","unstructured":"Kiuchi, K. (2024). General relativistic magnetohydrodynamics simulations for binary neutron star mergers. arXiv.","DOI":"10.1007\/978-981-97-8522-3_16"},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"231102","DOI":"10.1103\/PhysRevLett.119.231102","article-title":"Three-Dimensional General-Relativistic Magnetohydrodynamic Simulations of Remnant Accretion Disks from Neutron Star Mergers: Outflows and r-Process Nucleosynthesis","volume":"119","author":"Siegel","year":"2017","journal-title":"Phys. Rev. Lett."},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"104028","DOI":"10.1103\/PhysRevD.105.104028","article-title":"Jet launching from binary neutron star mergers: Incorporating neutrino transport and magnetic fields","volume":"105","author":"Sun","year":"2022","journal-title":"Phys. Rev. D"},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"061101","DOI":"10.1103\/PhysRevLett.128.061101","article-title":"Magnetohydrodynamic Simulations of Self-Consistent Rotating Neutron Stars with Mixed Poloidal and Toroidal Magnetic Fields","volume":"128","author":"Tsokaros","year":"2022","journal-title":"Phys. Rev. Lett."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"3373","DOI":"10.1093\/mnras\/sty2932","article-title":"Long-term GRMHD simulations of neutron star merger accretion discs: Implications for electromagnetic counterparts","volume":"482","author":"Tchekhovskoy","year":"2019","journal-title":"Mon. Not. R. Astron. Soc."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"044019","DOI":"10.1103\/PhysRevD.93.044019","article-title":"Low mass binary neutron star mergers: Gravitational waves and neutrino emission","volume":"93","author":"Foucart","year":"2016","journal-title":"Phys. Rev. D"},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"4760","DOI":"10.1093\/mnras\/stac2333","article-title":"Numerical relativity simulations of the neutron star merger GW190425: Microphysics and mass ratio effects","volume":"516","author":"Camilletti","year":"2022","journal-title":"Mon. Not. Roy. Astron. Soc."},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"27","DOI":"10.1007\/s10714-020-02751-6","article-title":"Interpreting Binary Neutron Star Mergers: Describing the Binary Neutron Star Dynamics, Modelling Gravitational Waveforms, and Analyzing Detections","volume":"53","author":"Dietrich","year":"2021","journal-title":"Gen. Rel. Grav."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"023012","DOI":"10.1103\/PhysRevD.92.023012","article-title":"Constraining the neutron star equation of state with gravitational wave signals from coalescing binary neutron stars","volume":"92","author":"Agathos","year":"2015","journal-title":"Phys. Rev. D"},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"131101","DOI":"10.1103\/PhysRevLett.111.131101","article-title":"Prompt Merger Collapse and the Maximum Mass of Neutron Stars","volume":"111","author":"Bauswein","year":"2013","journal-title":"Phys. Rev. Lett."},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"015007","DOI":"10.1103\/RevModPhys.89.015007","article-title":"Equations of state for supernovae and compact stars","volume":"89","author":"Oertel","year":"2017","journal-title":"Rev. Mod. Phys."},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"1455","DOI":"10.1103\/RevModPhys.80.1455","article-title":"Color superconductivity in dense quark matter","volume":"80","author":"Alford","year":"2008","journal-title":"Rev. Mod. Phys."},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"626","DOI":"10.1086\/500349","article-title":"Primitive Variable Solvers for Conservative General Relativistic Magnetohydrodynamics","volume":"641","author":"Noble","year":"2006","journal-title":"Astrophys. J."},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"1","DOI":"10.12942\/lrr-2012-8","article-title":"Binary neutron star mergers","volume":"15","author":"Faber","year":"2012","journal-title":"Living Rev. Relativ."},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"024028","DOI":"10.1103\/PhysRevD.72.024028","article-title":"Relativistic magnetohydrodynamics in dynamical spacetimes: Numerical methods and tests","volume":"72","author":"Duez","year":"2005","journal-title":"Phys. Rev. D"},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"2","DOI":"10.12942\/lrr-2000-2","article-title":"Numerical Hydrodynamics in General Relativity","volume":"3","author":"Font","year":"2000","journal-title":"Living Rev. Relativ."},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"206","DOI":"10.1093\/mnras\/staa1532","article-title":"General relativistic hydrodynamics on a moving-mesh I: Static space\u2013times","volume":"496","author":"Chang","year":"2020","journal-title":"Mon. Not. Roy. Astron. Soc."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"025016","DOI":"10.1088\/1361-6382\/ad9c11","article-title":"AsterX: A new open-source GPU-accelerated GRMHD code for dynamical spacetimes","volume":"42","author":"Kalinani","year":"2025","journal-title":"Class. Quant. Grav."},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Zhu, H., Fields, J., Zappa, F., Radice, D., Stone, J., Rashti, A., Cook, W., Bernuzzi, S., and Daszuta, B. (2024). Performance-Portable Numerical Relativity with AthenaK. arXiv.","DOI":"10.3847\/1538-4365\/adcf96"},{"key":"ref_22","doi-asserted-by":"crossref","first-page":"135006","DOI":"10.1088\/1361-6382\/ab8fcd","article-title":"Toward fidelity and scalability in non-vacuum mergers","volume":"37","author":"Liebling","year":"2020","journal-title":"Class. Quant. Grav."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"Dieselhorst, T., Cook, W., Bernuzzi, S., and Radice, D. (2021). Machine Learning for Conservative-to-Primitive in Relativistic Hydrodynamics. Symmetry, 13.","DOI":"10.3390\/sym13112157"},{"key":"ref_24","unstructured":"Ansel, J., Yang, E., He, H., Gimelshein, N., Jain, A., Voznesensky, M., Bao, B., Bell, P., Berard, D., and Burovski, E. (May, January 27). PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph Compilation. Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS \u201924), ACM, La Jolla, CA, USA."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"023018","DOI":"10.1103\/PhysRevD.103.023018","article-title":"Robust Recovery of Primitive Variables in Relativistic Ideal Magnetohydrodynamics","volume":"103","author":"Kastaun","year":"2021","journal-title":"Phys. Rev. D"},{"key":"ref_26","doi-asserted-by":"crossref","first-page":"221","DOI":"10.1086\/303604","article-title":"Numerical 3 + 1 General Relativistic Hydrodynamics: A Local Characteristic Approach","volume":"476","author":"Banyuls","year":"1997","journal-title":"Astrophys. J."},{"key":"ref_27","doi-asserted-by":"crossref","first-page":"7","DOI":"10.12942\/lrr-2003-7","article-title":"Numerical Hydrodynamics in Special Relativity","volume":"6","year":"2003","journal-title":"Living Rev. Relativ."},{"key":"ref_28","doi-asserted-by":"crossref","first-page":"7","DOI":"10.12942\/lrr-2008-7","article-title":"Numerical Hydrodynamics and Magnetohydrodynamics in General Relativity","volume":"11","author":"Font","year":"2008","journal-title":"Living Rev. Relativ."},{"key":"ref_29","first-page":"360","article-title":"Does artificial viscosity destroy prompt type-II supernova explosions?","volume":"268","author":"Janka","year":"1993","journal-title":"Astron. Astrophys."},{"key":"ref_30","doi-asserted-by":"crossref","first-page":"124032","DOI":"10.1103\/PhysRevD.79.124032","article-title":"Constraints on a Phenomenologically Parametrized Neutron-Star Equation of State","volume":"79","author":"Read","year":"2009","journal-title":"Phys. Rev. D"},{"key":"ref_31","doi-asserted-by":"crossref","first-page":"065802","DOI":"10.1103\/PhysRevC.96.065802","article-title":"Open-Source Nuclear Equation of State Framework Based on the Liquid-Drop Model with Skyrme Interaction","volume":"96","author":"Schneider","year":"2017","journal-title":"Phys. Rev. C"},{"key":"ref_32","unstructured":"Wouters, T. (2024). Machine Learning Algorithms for the Conservative-to-Primitive Conversion in Relativistic Hydrodynamics. [Master\u2019s Thesis, KU Leuven]."},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"1488","DOI":"10.1093\/mnras\/staa1860","article-title":"Accretion-Induced Prompt Black Hole Formation in Asymmetric Neutron Star Mergers, Dynamical Ejecta and Kilonova Signals","volume":"497","author":"Bernuzzi","year":"2020","journal-title":"Mon. Not. R. Astron. Soc."},{"key":"ref_34","doi-asserted-by":"crossref","unstructured":"Boerner, T.J., Deems, S., Furlani, T.R., Knuth, S.L., and Towns, J. (2023, January 23\u201327). ACCESS: Advancing Innovation: NSF\u2019s Advanced Cyberinfrastructure Coordination Ecosystem: Services & Support. Proceedings of the Practice and Experience in Advanced Research Computing 2023: Computing for the Common Good, New York, NY, USA.","DOI":"10.1145\/3569951.3597559"},{"key":"ref_35","doi-asserted-by":"crossref","first-page":"90","DOI":"10.1109\/MCSE.2007.55","article-title":"Matplotlib: A 2D graphics environment","volume":"9","author":"Hunter","year":"2007","journal-title":"Comput. Sci. Eng."},{"key":"ref_36","doi-asserted-by":"crossref","first-page":"3021","DOI":"10.21105\/joss.03021","article-title":"seaborn: Statistical data visualization","volume":"6","author":"Waskom","year":"2021","journal-title":"J. Open Source Softw."}],"container-title":["Symmetry"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2073-8994\/17\/9\/1409\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,9]],"date-time":"2025-10-09T18:35:00Z","timestamp":1760034900000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2073-8994\/17\/9\/1409"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,8,29]]},"references-count":36,"journal-issue":{"issue":"9","published-online":{"date-parts":[[2025,9]]}},"alternative-id":["sym17091409"],"URL":"https:\/\/doi.org\/10.3390\/sym17091409","relation":{},"ISSN":["2073-8994"],"issn-type":[{"type":"electronic","value":"2073-8994"}],"subject":[],"published":{"date-parts":[[2025,8,29]]}}}