## 4 Numerical Examples
### GPU Memory Usage Analysis
All wavefield data involved in this forward modeling process are unrelated to gradients, thereby requiring less GPU memory. Overall, under downtimescale parameters, total GPU memory consumption is reduced by nearly half compared to the original scale. For the downtimespacescale, a similar process is followed, where forward modeling is first performed on the original-scale branch. After transforming the information to the reduced -scale model, the number of time points required for inversion on the reduced -scale branch becomes 400, with the grid size reduced to \(50\times 50\). Since the GPU memory usage for wavefield data in each RNN unit is directly related to the number of grid points, reducing the grid size from \(100\times 100\) to \(50\times 50\), while the time points decreasing from 1600 to 400 significantly decreases resource usage. Consequently, under downtimescalescale, the resource consumption for intermediate activation values during the inversion process is approximately one-sixteenth of that under the original scale. The remaining resource consumption primarily arises from the forward modeling on the original-scale model. We utilized PyTorch's (version 1.12.0) memory profiling framework and computational storage analysis to calculate the GPU memory consumption per epoch for the dual-PIRNN FWI network architecture shown in Figure 2. Using the parameters in Table 4 as an example, the intermediate activation values require storing the wavefield information within each RNN unit. As depicted in the internal structure of the SGFD RNN operator in Figure 3, the velocity parameter \(v\) is set as a trainable parameter in the network, necessitating the storage of gradient information for all variables related to \(v\) during training. This storage requirement effectively doubles the GPU memory usage for these variables. Figure 3 illustrates a simplified RNN unit structure, excluding SPML-related computations. Variables related to the velocity parameter \(v\) include, \(\partial_{x}v_{x}^{k+1/2}\partial_{z}v_{z}^{k+1/2}\), \(p_{x}^{k+1}\), \(p_{x}^{k+1}\), \(v_{x}^{k+1/2}\), and \(v_{z}^{k+1/2}\). Adding the v-related variables in SPML, there are 16 intermediate variables requiring gradients and 2 that do not, namely \(\partial_{x}p^{k}\) and \(\partial_{z}p^{k}\). Using this information, we can calculate the approximate GPU resources required for a one-time point. Each variable requires approximately \(120\times 120\times 4\div 1024\approx 56.25\) kb of space. For variables requiring gradients, this is approximately \(56.25\times 2=112.5\) kb. Thus, the total size of all stored variables for a one-time point is approximately \((56.25\times 2+112.5\times 16)\div 1024\approx 1.8677\) Mb. With 11 shots set and 1600 time points per shot, the total space required is \(1.8677\times 1600\times 11\div 1024\approx 32.1\) Gb. This result is derived from theoretical calculations. Additionally, we obtained a GPU resource consumption of approximately 32.5 GB using PyTorch's GPU memory profiling functions. The remaining resource usage includes optimizer parameters and other factors, validating the accuracy and reasonableness of our calculation process. The above calculations regarding GPU memory consumption reveal that, within the current inversion network framework, the majority of resource utilization is attributed to storing intermediate wavefield data associated with the velocity parameter \(v\). The magnitude of this resource consumption is directly proportional to the number of time points and grid points. as shown in Table 4, under the downtimescale condition, where the number of time points is reduced from 1600 to 800, the resource consumption for intermediate activation values decreases from approximately 32.1 GB to 16 GB, achieving a 50% reduction in memory usage. Similarly, under the downtimespacescale condition, the grid size is reduced from \(100\times 100\) to \(50\times 50\), and the number of time points is decreased from 1600 to 400.