Cách sử dụng độ chính xác hỗn hợp trong các mô hình đại dương: khám phá khả năng giảm độ chính xác số trong NEMO 4.0 và ROMS 3.6

Geoscientific Model Development - Tập 12 Số 7 - Trang 3135-3148
Oriol Tintó Prims1,2, Mario Acosta1, Andrew M. Moore3, Miguel Castrillo1, Kim Serradell1, Ana Cortés2, Francisco J. Doblas‐Reyes1,4
1Earth Sciences Department, Barcelona Supercomputing Center – Centro Nacional de Supercomputación, Barcelona, Spain
2HPCA4SE research group, Computer Architecture and Operating Systems Department, Universitat Autònoma de Barcelona, Bellaterra, Spain
3Ocean Sciences Department, University of California, Santa Cruz, CA, USA
4ICREA, Barcelona, Spain

Tóm tắt

Tóm tắt. Các phương pháp hỗn hợp độ chính xác có thể cung cấp sự gia tăng tốc độ đáng kể cho cả mã được giới hạn bởi tính toán và bộ nhớ với ít nỗ lực. Hầu hết các mã khoa học đều đã tối ưu hóa độ chính xác số quá mức, dẫn đến tình huống trong đó các mô hình đang sử dụng nhiều tài nguyên hơn mức cần thiết mà không biết đâu là điều cần thiết và đâu không. Do đó, có thể cải thiện hiệu suất tính toán bằng cách thiết lập lựa chọn độ chính xác phù hợp hơn. Đầu vào duy nhất cần thiết là một phương pháp để xác định các biến số thực nào có thể được biểu diễn bằng ít bit hơn mà không ảnh hưởng đến độ chính xác của kết quả. Bài báo này trình bày một phương pháp mới cho phép các mã hiện đại và mã cũ đều hưởng lợi từ việc giảm độ chính xác của một số biến mà không hy sinh độ chính xác. Phương pháp này bao gồm một ý tưởng đơn giản: chúng ta giảm độ chính xác của một nhóm các biến và đo lường cách nó ảnh hưởng đến đầu ra. Sau đó, chúng ta có thể đánh giá mức độ chính xác mà chúng thực sự cần. Việc sửa đổi và biên dịch lại mã cho từng trường hợp cần đánh giá sẽ đòi hỏi một lượng công sức quá lớn. Thay vào đó, phương pháp được trình bày trong bài báo này dựa vào việc sử dụng một công cụ gọi là trình giả lập độ chính xác giảm (RPE) có thể làm đơn giản hóa đáng kể quá trình. Sử dụng RPE và một danh sách các tham số chứa các mức độ chính xác sẽ được sử dụng cho từng biến số thực trong mã, có thể trong một nhị phân duy nhất để mô phỏng hiệu ứng lên các đầu ra của một lựa chọn cụ thể về độ chính xác. Khi chúng ta có thể mô phỏng các hiệu ứng của độ chính xác giảm, chúng ta có thể tiến hành thiết kế các bài kiểm tra sẽ cho chúng ta kiến thức về độ nhạy của các biến mô hình liên quan đến độ chính xác số của chúng. Số lượng các kết hợp khả thi là rất lớn và do đó, không thể khám phá. Giải pháp thay thế của việc thực hiện một cuộc kiểm tra từng biến riêng lẻ có thể cung cấp một số hiểu biết về độ chính xác cần thiết của các biến, nhưng ngược lại, các tương tác phức tạp khác liên quan đến nhiều biến có thể vẫn bị ẩn giấu. Thay vào đó, chúng ta sử dụng một thuật toán chia và chinh phục để xác định các phần yêu cầu độ chính xác cao và thiết lập một tập hợp các biến có thể chịu đựng độ chính xác giảm. Phương pháp này đã được thử nghiệm bằng hai mô hình đại dương tiên tiến nhất hiện nay, Nucleus for European Modelling of the Ocean (NEMO) và Hệ thống Mô hình Đại dương Khu vực (ROMS), với kết quả rất hứa hẹn. Việc thu thập thông tin này là điều tối quan trọng để xây dựng một phiên bản thực tế với độ chính xác hỗn hợp của mã trong giai đoạn tiếp theo sẽ mang lại những lợi ích hiệu suất như đã hứa.

Từ khóa


Tài liệu tham khảo

Aumont, O., Ethé, C., Tagliabue, A., Bopp, L., and Gehlen, M.: PISCES-v2: an ocean biogeochemical model for carbon and ecosystem studies, Geosci. Model Dev., 8, 2465–2513, https://doi.org/10.5194/gmd-8-2465-2015, 2015. a

Baboulin, M., Buttari, A., Dongarra, J., Kurzak, J., Langou, J., Langou, J., Luszczek, P., and Tomov, S.: Accelerating scientific computations with mixed precision algorithms, Comput. Phys. Commun., 180, 2526–2533, https://doi.org/10.1016/j.cpc.2008.11.005, 2009. a, b, c

Bauer, P., Thorpe, A., and Brunet, G.: The quiet revolution of numerical weather prediction, Nature, 525, 47–55, https://doi.org/10.1038/nature14956, 2015. a, b

Bellard, C., Bertelsmeier, C., Leadley, P., Thuiller, W., and Courchamp, F.: Impacts of climate change on the future of biodiversity, Ecol. Lett., 15, 365–377, https://doi.org/10.1111/j.1461-0248.2011.01736.x, 2012. a

Dawson, A. and Dueben, P.: aopp-pred/rpe: v5.0.0 (Version v5.0.0), Zenodo, https://doi.org/10.5281/zenodo.154483, 2016. a

Dawson, A. and Düben, P. D.: rpe v5: an emulator for reduced floating-point precision in large numerical simulations, Geosci. Model Dev., 10, 2221–2230, https://doi.org/10.5194/gmd-10-2221-2017, 2017. a, b, c

Dennis, J. M. and Loft, R. D.: Refactoring Scientific Applications for Massive Parallelism, in: Numerical Techniques for Global Atmospheric Models, 80, 539–556, https://doi.org/10.1007/978-3-642-11640-7_16, 2011. a

Düben, P. D., McNamara, H., and Palmer, T. N.: The use of imprecise processing to improve accuracy in weather & climate prediction, J. Comput. Phys., 271, 2–18, https://doi.org/10.1016/j.jcp.2013.10.042, 2014. a

Düben, P. D., Subramanian, A., Dawson, A., and Palmer, T. N.: A study of reduced numerical precision to make superparameterization more competitive using a hardware emulator in the OpenIFS model, J. Adv. Model. Earth Sy., 9, 566–584, https://doi.org/10.1002/2016MS000862, 2017. a

Düben, P. D., Subramanian, A., Dawson, A., and Palmer, T. N.: A study of reduced numerical precision to make superparameterization more competitive using a hardware emulator in the OpenIFS model, J. Adv. Model. Earth Sy., 9, 566–584, https://doi.org/10.1002/2016MS000862, 2017. a

Graillat, S., Fabienne, J., Picot, R., and Lathuili, B.: PROMISE: floating-point precision tuning with stochastic arithmetic, 17th international symposium on Scientific Computing, Computer Arithmetic and Verified Numerics (SCAN 2016), UPPSALA, Sweden, 98–99, September 2016. a

Haidar, A., Tomov, S., Dongarra, J., and Higham, N. J.: Harnessing GPU Tensor Cores for Fast FP16 Arithmetic to Speed up Mixed-Precision Iterative Refinement Solvers, in: Proceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis, SC'18 (Dallas, TX), IEEE Press, Piscataway, NJ, USA, 47:1–47:11, available at: http://dl.acm.org/citation.cfm?id=3291656.3291719 (last access: July 2019), 2018. a

Hegerl, G. and Zwiers, F.: Use of models in detection and attribution of climate change, Wires Clim. Change, 2, 570–591, https://doi.org/10.1002/wcc.121, 2011. a

Kniveton, D. R., Smith, C. D., and Black, R.: Emerging migration flows in a changing climate in dryland Africa, Nat. Clim. Change, 2, 444–447, https://doi.org/10.1038/nclimate1447, 2012. a

Lam, M. O., De Supinksi, B. R., Legendre, M. P., and Hollingsworth, J. K.: Automatically adapting programs for mixed-precision floating-point computation, Proceedings – 2012 SC Companion: High Performance Computing, Networking Storage and Analysis, SCC 2012, 1423–1424, https://doi.org/10.1109/SC.Companion.2012.231, 2012. a

Madec, G.: NEMO ocean engine, Note du Pole de modelisatio 1288–1619, https://www.nemo-ocean.eu/wp-content/uploads/Doc_OPA8.1.pdf (last access: July 2019), 2008. a

Moore, A., Arango, H., Broquet, G., S. Powell, B., Weaver, A., and Zavala-Garay, J.: The Regional Ocean Modeling System (ROMS) 4-dimensional variational data assimilation systems Part I – System overview and formulation, Prog. Oceanogr., 91, 34–49, https://doi.org/10.1016/j.pocean.2011.05.004, 2011. a

Oreskes, N., Stainforth, D. A., and Smith, L. A.: Adaptation to Global Warming: Do Climate Models Tell Us What We Need to Know?, Philos. Sci., 77, 1012–1028, https://doi.org/10.1086/657428, 2010. a

Palmer, T., Shutts, G., Hagedorn, R., Doblas-Reyes, F., Jung, T., and Leutbecher, M.: Representing model uncertainty in wheather and climate prediction, Annu. Rev. Earth Pl. Sc., 33, 163–193, https://doi.org/10.1146/annurev.earth.33.092203.122552, 2005. a

Randall, D., Wood, R., Bony, S., Colman, R., Fichefet, T., Fyfe, J., Kattsov, V., Pitman, A., Shukla, J., Srinivasan, J., Stouffer, R., Sumi, A., and Taylor, K.: Climate Models and Their Evaluation, in: IPCC, 2007: Climate Change 2007: the physical science basis. contribution of Working Group I to the Fourth Assessment Report of the Intergovernmental Panel on Climate Change, 323, 589–662, https://doi.org/10.1016/j.cub.2007.06.045, 2007. a

Rousset, C., Vancoppenolle, M., Madec, G., Fichefet, T., Flavoni, S., Barthélemy, A., Benshila, R., Chanut, J., Levy, C., Masson, S., and Vivier, F.: The Louvain-La-Neuve sea ice model LIM3.6: global and regional capabilities, Geosci. Model Dev., 8, 2991–3005, https://doi.org/10.5194/gmd-8-2991-2015, 2015. a

The ROMS/TOMS Group: ROMS, available at: http://www.myroms.org/, last access: July 2019. a

Thornes, T.: Can reducing precision improve accuracy in weather and climate models?, Weather, 71, 147–150, https://doi.org/10.1002/wea.2732, 2016. a

Tintó Prims, O.: AutoRPE, available at: https://earth.bsc.es/gitlab/otinto/AutoRPE, last access: July 2019.  a, b

Tintó Prims, O., Castrillo, M., Acosta, M., Mula-Valls, O., Sanchez Lorente, A., Serradell, K., Cortés, A., and Doblas-Reyes, F.: Finding, analysing and solving MPI communication bottlenecks in Earth System models, J. Comput. Sci., https://doi.org/10.1016/j.jocs.2018.04.015, in press, 2018. a

Váňa, F., Düben, P., Lang, S., Palmer, T., Leutbecher, M., Salmond, D., and Carver, G.: Single Precision in Weather Forecasting Models: An Evaluation with the IFS, Mon. Weather Rev., 145, 495–502, https://doi.org/10.1175/MWR-D-16-0228.1, 2017. a

Whiteman, G. and Hope, C. W. P.: Vast costs of Arctic change, Nature, 499, 401–403, https://doi.org/10.1038/499401a, 2013. a