| 69 | } // namespace |
| 70 | |
| 71 | int main(int argc, char** argv) { |
| 72 | xla::RunHloModuleOptions opts; |
| 73 | std::vector<tensorflow::Flag> flag_list = { |
| 74 | tensorflow::Flag( |
| 75 | "platform", &opts.platform, |
| 76 | "The test platform that the HLO module will be executed on " |
| 77 | "(gpu, cpu, etc)."), |
| 78 | tensorflow::Flag( |
| 79 | "reference_platform", &opts.reference_platform, |
| 80 | "The reference platform that HLO module will be " |
| 81 | "executed on. The result produced on the reference platform will " |
| 82 | "be compared against the result produced on the test platform. A " |
| 83 | "value of 'default' will use the TPU_Interpreter as a reference if " |
| 84 | "the test platform is a TPU, and 'interpreter' otherwise. If the " |
| 85 | "flag value is the empty string, then the module will not be run " |
| 86 | "on a reference platform at all."), |
| 87 | tensorflow::Flag("print_literals", &opts.print_literals, |
| 88 | "Print the input and result literals to stdout."), |
| 89 | tensorflow::Flag( |
| 90 | "run_test_hlo_passes", &opts.run_test_hlo_passes, |
| 91 | "Run HLO pass pipeline for the test platform on the HLO module " |
| 92 | "before running the module on the test platform. This should be " |
| 93 | "set to true if the HLO module is unoptimized and set to false if " |
| 94 | "the HLO module already has been optimized."), |
| 95 | tensorflow::Flag( |
| 96 | "run_reference_hlo_passes", &opts.run_reference_hlo_passes, |
| 97 | "Run HLO pass pipeline for the reference platform on the HLO module " |
| 98 | "before running the module on the reference platform. " |
| 99 | "In general, if the given HLO module was optimized for a platform " |
| 100 | "other " |
| 101 | "than the reference this is necessary because some HLO passes are " |
| 102 | "legalization passes which must be run prior to code generation."), |
| 103 | |
| 104 | tensorflow::Flag( |
| 105 | "use_large_float_range", &opts.use_large_float_range, |
| 106 | "Generate floating point values using a large uniform-log " |
| 107 | "distribution as opposed to a small uniform distribution."), |
| 108 | tensorflow::Flag( |
| 109 | "abs_error_bound", &opts.abs_error_bound, |
| 110 | "The absolute error bound used when comparing the test and " |
| 111 | "reference results."), |
| 112 | tensorflow::Flag( |
| 113 | "rel_error_bound", &opts.rel_error_bound, |
| 114 | "The relative error bound used when comparing the test and " |
| 115 | "reference results."), |
| 116 | tensorflow::Flag("input_format", &opts.input_format, |
| 117 | "The format of the input file. Valid values:\n" |
| 118 | " hlo : HLO textual format\n" |
| 119 | " pb : xla::HloProto in binary proto format\n" |
| 120 | " pbtxt : xla::HloProto in text proto format"), |
| 121 | tensorflow::Flag( |
| 122 | "input_module", &opts.input_module, |
| 123 | "A path to a file containing the HLO module. Can also pass " |
| 124 | "a this as argv[1], but this flag is more explicit."), |
| 125 | tensorflow::Flag( |
| 126 | "iterations", &opts.iterations, |
| 127 | "The number of times to run the module. Each iteration will be run " |
| 128 | "with different input data.")}; |
nothing calls this directly
no test coverage detected