MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / main

Function main

examples/cpp/multi_gpu_gpt/multi_gpu_gpt_example.cc:37–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35void multi_gpu_gpt_example(const INIReader reader, std::string in_csv);
36
37int main(int argc, char* argv[])
38{
39 mpi::initialize(&argc, &argv);
40 srand(0);
41
42 std::string ini_name;
43 if (argc >= 2) {
44 ini_name = std::string(argv[1]);
45 }
46 else {
47 ini_name = "../examples/cpp/multi_gpu_gpt/gpt_config.ini";
48 }
49
50 std::string in_csv;
51 if (argc == 3) {
52 in_csv = std::string(argv[2]);
53 }
54 else {
55 in_csv = "../examples/cpp/multi_gpu_gpt/start_ids.csv";
56 }
57
58 INIReader reader = INIReader(ini_name);
59 if (reader.ParseError() < 0) {
60 std::cout << "[ERROR] Can't load '" << ini_name << "'\n";
61 return -1;
62 }
63 const std::string data_type = reader.Get("ft_instance_hyperparameter", "data_type");
64
65 if (data_type == "fp32") {
66 multi_gpu_gpt_example<float>(reader, in_csv);
67 }
68 else if (data_type == "fp16") {
69 multi_gpu_gpt_example<half>(reader, in_csv);
70 }
71#ifdef ENABLE_BF16
72 else if (data_type == "bf16") {
73 multi_gpu_gpt_example<__nv_bfloat16>(reader, in_csv);
74 }
75#endif
76 else {
77 printf("[ERROR] data_type should be fp32, fp16 or bf16 ! \n");
78 return -1;
79 }
80 mpi::finalize();
81 return 0;
82}

Callers

nothing calls this directly

Calls 4

initializeFunction · 0.85
INIReaderClass · 0.85
ParseErrorMethod · 0.80
GetMethod · 0.80

Tested by

no test coverage detected