Table of Contents
Fetching ...

Scalable Stellar Parameter Inference Using Python-based LASP: From CPU Optimization to GPU Acceleration

Jun-Chao Liang, Yin-Bi Li, A-Li Luo, Fang Zuo, Bing Du, Shuo Li, Xiao-Xiao Ma, Shu-Guo Ma, Hai-Ling Lu, Ke-Fei Wu, Zhi-Hua Zhong, Wen Hou, Xiao Kong, Shuo Ye, Li-Li Wang, Hugh R. A. Jones

TL;DR

This work addresses the need for scalable, cross-survey stellar parameter inference in massive spectroscopic datasets by replacing the IDL-based LASP with a Python-based framework (PyLASP) that supports joint modeling and GPU acceleration. It introduces two complementary optimization strategies: LASP-CurveFit, a CPU-optimized reimplementation preserving LASP logic, and LASP-Adam-GPU, a GPU-accelerated, grouped optimization pipeline built on PyTorch. Through extensive experiments on LAMOST DR10 and DESI data, PyLASP demonstrates substantial throughput gains (e.g., tens of millions of spectra processed in hours on GPUs), close agreement with the original LASP on parameter estimates, and reliable model-based error estimates for $T_{ ext{eff}}$, $ ext{log} g$, and [Fe/H], with some caveats for radial velocity due to unmodeled systematics. The framework shows strong cross-survey applicability, offering improved efficiency and flexibility for upcoming large-scale surveys, and provides the code and catalogs for community use. These results establish PyLASP as a practical foundation for scalable, high-dimensional stellar parameter inference across multiple spectroscopic surveys.

Abstract

To enhance the efficiency, scalability, and cross-survey applicability of stellar parameter inference in large spectroscopic datasets, we present a modular, parallelized Python framework with automated error estimation, built on the LAMOST Atmospheric Parameter Pipeline (LASP) originally implemented in IDL. Rather than a direct code translation, this framework refactors LASP with two complementary modules: LASP-CurveFit, a new implementation of the LASP fitting procedure that runs on a CPU, preserving legacy logic while improving data I/O and multithreaded execution efficiency; and LASP-Adam-GPU, a GPU-accelerated method that introduces grouped optimization by constructing a joint residual function over multiple observed and model spectra, enabling high-throughput parameter inference across tens of millions of spectra. Applied to 10 million LAMOST spectra, the framework reduces runtime from 84 to 48 hr on the same CPU platform and to 7 hr on an NVIDIA A100 GPU, while producing results consistent with those from the original pipeline. The inferred errors agree well with the parameter variations from repeat observations of the same target (excluding radial velocities), while the official empirical errors used in LASP are more conservative. When applied to DESI DR1, our effective temperatures and surface gravities agree better with APOGEE than those from the DESI pipeline, particularly for cool giants, while the latter performs slightly better in radial velocity and metallicity. These results suggest that the framework delivers reliable accuracy, efficiency, and transferability, offering a practical approach to parameter inference in large spectroscopic surveys. The code and DESI-based catalog are available via \dataset[DOI: 10.12149/101679]{https://doi.org/10.12149/101679} and \dataset[DOI: 10.12149/101675]{https://doi.org/10.12149/101675}, respectively.

Scalable Stellar Parameter Inference Using Python-based LASP: From CPU Optimization to GPU Acceleration

TL;DR

This work addresses the need for scalable, cross-survey stellar parameter inference in massive spectroscopic datasets by replacing the IDL-based LASP with a Python-based framework (PyLASP) that supports joint modeling and GPU acceleration. It introduces two complementary optimization strategies: LASP-CurveFit, a CPU-optimized reimplementation preserving LASP logic, and LASP-Adam-GPU, a GPU-accelerated, grouped optimization pipeline built on PyTorch. Through extensive experiments on LAMOST DR10 and DESI data, PyLASP demonstrates substantial throughput gains (e.g., tens of millions of spectra processed in hours on GPUs), close agreement with the original LASP on parameter estimates, and reliable model-based error estimates for , , and [Fe/H], with some caveats for radial velocity due to unmodeled systematics. The framework shows strong cross-survey applicability, offering improved efficiency and flexibility for upcoming large-scale surveys, and provides the code and catalogs for community use. These results establish PyLASP as a practical foundation for scalable, high-dimensional stellar parameter inference across multiple spectroscopic surveys.

Abstract

To enhance the efficiency, scalability, and cross-survey applicability of stellar parameter inference in large spectroscopic datasets, we present a modular, parallelized Python framework with automated error estimation, built on the LAMOST Atmospheric Parameter Pipeline (LASP) originally implemented in IDL. Rather than a direct code translation, this framework refactors LASP with two complementary modules: LASP-CurveFit, a new implementation of the LASP fitting procedure that runs on a CPU, preserving legacy logic while improving data I/O and multithreaded execution efficiency; and LASP-Adam-GPU, a GPU-accelerated method that introduces grouped optimization by constructing a joint residual function over multiple observed and model spectra, enabling high-throughput parameter inference across tens of millions of spectra. Applied to 10 million LAMOST spectra, the framework reduces runtime from 84 to 48 hr on the same CPU platform and to 7 hr on an NVIDIA A100 GPU, while producing results consistent with those from the original pipeline. The inferred errors agree well with the parameter variations from repeat observations of the same target (excluding radial velocities), while the official empirical errors used in LASP are more conservative. When applied to DESI DR1, our effective temperatures and surface gravities agree better with APOGEE than those from the DESI pipeline, particularly for cool giants, while the latter performs slightly better in radial velocity and metallicity. These results suggest that the framework delivers reliable accuracy, efficiency, and transferability, offering a practical approach to parameter inference in large spectroscopic surveys. The code and DESI-based catalog are available via \dataset[DOI: 10.12149/101679]{https://doi.org/10.12149/101679} and \dataset[DOI: 10.12149/101675]{https://doi.org/10.12149/101675}, respectively.
Paper Structure (19 sections, 9 figures, 3 tables)

This paper contains 19 sections, 9 figures, 3 tables.

Figures (9)

  • Figure 1: Comparison of the computational efficiency of different LASP versions across hardware platforms. The left panel shows the runtime of LASP-MPFit and LASP-CurveFit for processing $10{,}000$ spectra under various efficiency parameter settings. The middle and right panels present the runtime of LASP-Adam on CPU and GPU platforms, respectively. The solid line indicates the IDL-based implementation, while dashed lines correspond to the Python-based version; line colors distinguish different hardware platforms. RTX 4060 refers to a mobile GPU integrated into a laptop with a Ryzen 9 7945HX processor. For clarity, the ' LASP' prefix has been omitted from all legend labels in the figure.
  • Figure 2: Comparison of $\mathrm{RV}$ (column 1), $T_\mathrm{eff}$ (column 2), $\log g$ (column 3), and [Fe/H] (column 4), inferred using LASP-CurveFit, LASP-Adam-GPU, and LASP-MPFit under both the No Clean and Clean strategies. From top to bottom, the four rows correspond to LASP-CurveFit versus LASP-MPFit (No Clean), LASP-Adam-GPU versus LASP-MPFit (No Clean), LASP-CurveFit versus LASP-MPFit (Clean), and LASP-Adam-GPU versus LASP-MPFit (Clean). The mean ($\mu$) and standard deviation ($\sigma$) of the differences are calculated using astropy.stats.sigma_clipped_stats with maxiters=1, excluding values beyond $5\sigma$. The ' LASP' prefix has been omitted in all figure labels for clarity.
  • Figure 3: Residual distributions between LASP-derived parameters and APOGEE DR$16$ labels for outlier cases. Only parameters with internal discrepancies exceeding $5\sigma$ between the Python and IDL versions are included. Each row corresponds to a stellar parameter ($T_\mathrm{eff}$, $\log g$, $\mathrm{[Fe/H]}$, and ${\mathrm{RV}}$, from top to bottom), and each column represents a different LASP implementation and pixel masking method: LASP-CurveFit with No Clean, LASP-CurveFit with Clean, LASP-Adam-GPU with No Clean, and LASP-Adam-GPU with Clean (from left to right). In each panel, the residuals between APOGEE labels and the parameters derived by both LASP-MPFit and PyLASP are shown, allowing direct comparison of their consistency with APOGEE. For clarity, the ' LASP' prefix is omitted from all legend labels.
  • Figure 4: Spectral flux of stars with $T_{\mathrm{eff}}$ differences exceeding $5\sigma$ between LASP-CurveFit and LASP-MPFit. The left panel (a) shows the spectra under the No Clean strategy (n=63), while the right panel (b) shows the spectra under the Clean strategy (n=27). Blue lines represent spectra with negative flux values, while red lines represent spectra with no negative flux values.
  • Figure 5: Stability test of initial values in PyLASP. $\Delta$ denotes the difference between stellar parameters inferred using fixed initial values $(T_{\mathrm{eff}}, \log g, \mathrm{[Fe/H]}) = (5000 \ \mathrm{K}, 3 \ \mathrm{dex}, -0.5 \ \mathrm{dex})$ and those inferred using CFI-derived initial values. For clarity, the legend is shown only in the first panel, and the ' LASP' prefix is omitted from all legend labels.
  • ...and 4 more figures