Aussie AI
Putting Portability into Supportability
-
Book Excerpt from "Generative AI in C++"
-
by David Spuler, Ph.D.
Putting Portability into Supportability
The basic best practices are to write portable code until you can't. Here are some suggestions to further finesse your portability coding practices for improved supportability:
1. Self-test portability issues at startup.
2. Print out platform settings into logs.
A good idea is to self-test that certain portability settings meet the minimum requirements of your application. It's necessary to check for the exact feature you want, not just for a particular CPU or GPU architecture. And you probably should do these feature self-tests even in the production versions that users run, not just in the debugging versions. It's only a handful of lines of code that can save you a lot of headaches later.
Also, you should detect and print out the current portability settings as part of the program's output (or report), or at least to the logs. Ideally, you would actually summarize these settings in the user's output display, which helps the poor phone jockeys trying to answers callers offering very useful problem summaries: “My AI doesn't work.”
If it's not a PEBKAC, then having the ability to get these platform settings to put into the incident log is very helpful in resolving production-level support issues. This is especially true if you have users running your software on different user interfaces, and, honestly, if you don't support multiple user interfaces, then what are you doing here?
You should also output backend portability settings for API or other backend software products. The idea works the same even if your “users” are programmers who are running your code on different hardware platforms or virtual machines, except that their issue summaries will be like: “My kernel fission optimizations of batch normalization core dump from a SIGILL whenever I pass it a Mersenne prime.”
• Next: • Up: Table of Contents |
The new AI programming book by Aussie AI co-founders:
Get your copy from Amazon: Generative AI in C++ |