Numerical exceptions, which may be caused by overflow, operations like division by 0 or sqrt(-1), or convergence failures, are unavoidable in many cases, in particular when software is used on unforeseen and difficult inputs. As more aspects of society become automated, e.g., self-driving cars, health monitors, and cyber-physical systems more generally, it is becoming increasingly important to design software that is resilient to exceptions, and that responds to them in a consistent way. Consistency is needed to allow users to build higher-level software that is also resilient and consistent (and so on recursively). In this paper we explore the design space of consistent exception handling for the widely used BLAS and LAPACK linear algebra libraries, pointing out a variety of instances of inconsistent exception handling in the current versions, and propose a new design that balances consistency, complexity, ease of use, and performance. Some compromises are needed, because there are preexisting inconsistencies that are outside our control, including in or between existing vendor BLAS implementations, different programming languages, and even compilers for the same programming language. And user requests from our surveys are quite diverse. We also propose our design as a possible model for other numerical software, and welcome comments on our design choices.
翻译:数字例外可能由外溢、分差0或sqrt(-1)(-1)等操作或趋同失败造成,在许多情况下是不可避免的,特别是当软件用于意外和困难的投入时。随着社会更多的方面变得自动化,例如自行驾驶的汽车、健康监测器和网络物理系统等,越来越需要设计能适应例外的软件,并且以一致的方式应对这些例外。需要保持一致性,以便用户能够建立更高层次的软件,这种软件也是有弹性和一致性的(以及循环性的)。在本文中,我们探索了对广泛使用的BLAS和LAPACK线形代数图书馆进行一致例外处理的设计空间,指出了当前版本中各种不一致的例外处理,提出了一种平衡一致性、复杂性、使用方便性和性的新设计。需要达成一些妥协,因为我们无法控制之前就存在不一致性,包括现有供应商BLAS执行选择、不同编程语言,甚至同一编程语言的编程者。我们调查中的用户请求模型非常值得欢迎,我们提出的其他设计是数字式的。我们提议了其他软件设计。